Discussion
Topics
Last Day
Last Week
Tree View

Search
New Messages
Keyword Search

Help
Getting Started
Formatting
Troubleshooting
Program Credits

Utilities
Edit Profile
Administration
Contact

 
forum - discussion board
- about - downloads - registration - forum - misc - home - © 1996-99 GWD Text Editor

How to "run" and "compile" Java program using GWD?

GWD Text Editor Forum: Technical Support: How to "run" and "compile" Java program using GWD?
Top of pagePrevious messageNext messageBottom of pageLink to this message  By Anonymous on Saturday, March 29, 2003 - 07:56 pm:

Can anyone teach me how to add the java.exe to GWD text editor? The way I did option->tools->add run in menu text->select the java.exe. And options->tools->add compile in menu text->select javac.exe.

I also specify $(FilePath)$(FileNameOnly), and in the Initial Directory $(FileDir), but everytime I run or compile the program, it is suppose to have a black window with the result , but the black window appears just for a few seconds, then it
is gone.

Then in "tools window", I tried to mark "Redirect to output window" bellow "Initial directory", and compile and run again. The result of "compile" the program is
compile: javac: invalid flag: C:\Comp182\TestLinkedList.javaTestLinkedList

And the result of "run" the program is
run: java.lang.NoClassDefFoundError: C:\Comp182\TestLinkedList/javaTestLinkedList
Exception in thread "main"


Top of pagePrevious messageNext messageBottom of pageLink to this message  By Vedran Gaco (Vgaco) on Tuesday, April 1, 2003 - 06:55 pm:

In the Arguments field of the Tools dialog box you should specify "-cp . $(FileNameOnly)", in the Initial Direcotry "$(FileDir)".

Note that your Java source file must be active in the GWD Text Editor.


Top of pagePrevious messageNext messageBottom of pageLink to this message  By Anonymous on Thursday, April 3, 2003 - 10:17 pm:

Hello Vedran Gaco,
I tried In the Arguments field of the Tools dialog box you should specify "-cp, and $(FileNameOnly)", in the Initial Direcotry "$(FileDir)" as you said above, but I still have problems.
First problem is that everytime I run or compile the program, it is suppose to have a black window with the result , but the black window appears just for a few seconds, then it is gone.
Second is that Then in "tools window", I tried to mark "Redirect to output window" bellow "Initial directory", and compile and run again. When I "run" the program it shows error:

Unrecognized option: -cd.W3
Could not creat the Java virtual machine
(W3 is the file name of my program)

and when I compile, it shows error:

Java: invalid flag: -cd.W3
Usage: Javac
where possible include.....

ps: And how do I know my Java source file is active in the GWD Text Editor? And how can I make it active in the GWD Text Editor?


Top of pagePrevious messageNext messageBottom of pageLink to this message  By Vedran Gaco (Vgaco) on Friday, April 4, 2003 - 12:08 pm:

In the Argument field you should specify "-cp . $(FileNameOnly)". Do not forget to spaces between -cp (not -cd), dot and $(FileNameOnly).

> And how do I know my Java source file is active
> in the GWD Text Editor? And how can I make it
> active in the GWD Text Editor?

Your *.java file must be opened in the GWD Text Editor.


Top of pagePrevious messageNext messageBottom of pageLink to this message  By Anonymous on Saturday, April 5, 2003 - 08:33 pm:

Hi Vedran Gaco,
In the Argument field I specify "-cp . $(FileNameOnly)" as you said above. I also spaced between -cp, dot and $(FileNameOnly). I still have 2 problems as above.
but the second problem is diferent:

when I "compile" the program (with marked "Redirect to output" in "tools window") the error is:
javac: invalid flag: -cp
and when I "run" the program, it shows a "running tool" windows"
In "running tool" Window, it shows:
Program
c:\......java.exe
Arguments
-cp . testmatching
(Testmatching is the file name of my program)
and stay like this for a long time until I click "cancel" button.


Top of pagePrevious messageNext messageBottom of pageLink to this message  By Anonymous on Friday, April 11, 2003 - 04:03 pm:

For compiling Java you should use javac.exe and for interpreting Java programs java.exe (not javac). -cp is the java (not javac) option which sets the classpath.

You should replace javac.exe whit java.exe in the Command field


Top of pagePrevious messageNext messageBottom of pageLink to this message  By Anonymous on Tuesday, April 15, 2003 - 11:49 pm:

I already replaced javac.exe for compiling Java and java.exe for interpreting Java programs in the Command field, but I still have the same problems as saying above.


Top of pagePrevious messageNext messageBottom of pageLink to this message  By kumaran on Thursday, February 10, 2005 - 06:09 am:

Notepad program using java programming


Add a Message


This is a public posting area. If you do not have an account, enter your full name into the "Username" box and leave the "Password" box empty. Your e-mail address is optional.
Username:  
Password:
E-mail:


- about - downloads - registration - forum - misc - home - © 1996-99 GWD Text Editor