Can't compile Java application

Help with setting up and configuring custom user tools in UltraEdit (based on command line input)

Can't compile Java application

Postby jwesneski » Mon Jan 24, 2005 9:30 pm

Feel like a dingbat, but I can't get UltraEdit to invoke 'javac' compiler.

Here's my path: C:\jdk5.1.0_01\bin\javac %F

What I get is just nothing - no reaction whatever. My 'javasource' folder is a subfolder after \bin.

"C:\jdk5.1.0_01\bin\javac javasource\mypgm.java" works fine on the cmd line from within DOS box
***********************************************************
2nd issue: on CMD line, following does not work:

C:\jdk5.1.0_01\bin\java javasource\mypgm
returns "exception in thread "main" java.lang.class.NoClassFoundDefError"

I have to be IN my source folder to execute the 'java mypgm' cmd!

What is going on here?

mainframe programmer :D
User avatar
jwesneski
Newbie
 
Posts: 3
Joined: Mon Jan 24, 2005 12:00 am

Re: Can't compile Java application

Postby Mofi » Tue Jan 25, 2005 2:45 am

There is a difference between %f and %F. See help for details. Try this:

Command line: "C:\jdk5.1.0_01\bin\javac.exe" "%f"
Working Directory: %p

The " should always be use with long file names. I don't know, but I think, javac is an exe so adding the extension disables the search of the windows kernel for a program named javac.

If javac needs other executables from it's bin directory, you have to add the javac bin directory to your path environment variable, if is not already done.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Can't compile Java application

Postby jwesneski » Tue Jan 25, 2005 6:12 pm

mofi, ich bedanke mich für deine Ideen, ich hab's probiert aber ohne Erfolg, hab' eigentlich alles probiert aber das wirkt nichts.

You mention the path environment variable. Forgive my novice stature in the pc world. Does your reference mean that I should have updated a windows file like autoexec.bat? All I did was install the jdk directly under my C: drive.

Thank you again for your assistance.

jwesneski
User avatar
jwesneski
Newbie
 
Posts: 3
Joined: Mon Jan 24, 2005 12:00 am

Re: Can't compile Java application

Postby jwesneski » Tue Jan 25, 2005 10:05 pm

For now i'll just keep compiling/executing via the DOS command line from

C:\jdk1.5.0_01\bin\

I've read from more experienced java folks that they feel that to be a better way to learn things anyway, at least for a novice.
User avatar
jwesneski
Newbie
 
Posts: 3
Joined: Mon Jan 24, 2005 12:00 am

Re: Can't compile Java application

Postby palou » Wed Jan 26, 2005 3:08 am

It seems you miss the PATH environment var.

Try adding "C:\jdk1.5.0_01\bin\" to the environment.

The way to do that depend on your OS (Win9x -> autoexec.bat, Win2000/XP -> System control panel), the windows help can tell you how to do.
User avatar
palou
Basic User
Basic User
 
Posts: 46
Joined: Fri Dec 17, 2004 12:00 am
Location: Geneva / Switzerland

Re: Can't compile Java application

Postby greynet » Sat Feb 19, 2005 6:52 am

jwesneski

i think you should try mofi's way to compiler java since with long java file name, it is quite time consuming to type the filename each time you want to compile and execute the file. besides it is very hard to check errors with dos prompt.

So here i give you settings which work on my PC (my java sdk is different from yours, so modifed the relevant settings)


command line: C:\j2sdk1.4.2_07\bin\javac.exe "%f"
working directory: %p
menu item name: java compiler

check boxes: save all file first, save active file, output to list box, show dos box, capture output

shoulds be work :wink:
User avatar
greynet
Newbie
 
Posts: 1
Joined: Sat Feb 19, 2005 12:00 am


Return to Custom User Tools/Tool Configuration