Compile Java Error: javac.exe

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
SNaHHaN
Posts: 2
Joined: Sat Feb 04, 2006 4:52 am

Compile Java Error: javac.exe

Post by SNaHHaN »

Hello.

Upon trying to compile my file, I receive the following error:

*Title in Blue: C:\WINDOWS\system32\javac.exe*
"The system cannot find the file specified."


I've done what the TextPad.com FAQ site told me to in regards to Delete the 3 JDK commands and then re-apply them. This didn't help.

I've also tried uninstalling, removing every "TextPad" inquiry from my registry, re-installing, and still getting the error.

Perhaps I installed JDK incorrectly. I downloaded the installation file, installed it. Do I need to do anything else to it? I have re-installed this multiple times tonight as well as TextPad.

Also, I tried going to the HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.4 directory in my registry, but I cannot locate the file Java Development Kit within JavaSoft.

Any help would be appreciated. I have my first project due in a few days, so I need to work on my first lab. of Java Programming. Thanks in advance for your help!
SNaHHaN
Posts: 2
Joined: Sat Feb 04, 2006 4:52 am

Post by SNaHHaN »

I managed to be able to solve this myself. I apologize deeply for any additional work this may have caused anyone.

For those that are having similar problems, I didn't realize that I needed to download the Development Kit in addition to "The Java 2 Enterprise Edition 1.4 SDK." Go to http://java.sun.com/j2se/1.5.0/download.jsp and make sure you click the "Download JDK 5.0 Update 6" in the middle and install the Development Kit.

Now I can program! Thanks, and sorry for the hassle!
User avatar
shohreh
Posts: 4
Joined: Sun Apr 23, 2006 9:43 pm
Contact:

How do I set up the compile and run command

Post by shohreh »

I tried downloading JDK 5.0 Update 6, but it still gives me the javac error.
C:\WINDOWS\system32\javac.exe.

What do I insert into the run command, parameters, initial folder?


Please reply I would truly appreciate your help.
molasses
Posts: 1
Joined: Tue Apr 25, 2006 3:24 pm

Post by molasses »

Sounds like the java compiler command "javac" can not be located by your system.
By default the JDK places the various java commands within a "bin" directory.
For the latest JDK version, the default location is:
C:\Program Files\Java\jdk1.5.0_06\bin
This is normally where all of the java exe's are located (for this build).
So what you would have to do is add that location to your path environment, so it will be there all the time.
In XP go to
Desktop / Right Click "My Computer" / Select "Properties" / Mouse to and select the "Advanced Tab"
Towards bottom of Advanced Tab select and open "Environment Variables"
Mouse to the Bottom Window which should be named "System Variables", select "Path", and click "Edit"
The Variable Value will be highlighted, press the "End" key or navigate to the very end of the Variable Value for Path.
At the end of the value, put a ";" and the path to the bin directory for the JDK. <no quotes>
So what you MAY insert would be something like this:
;C:\Program Files\Java\jdk1.5.0_06\bin

Then click OK / OK / OK
For it to take effect in the java environment, you need to <at a minimum> log out and relog on, or just reboot.

Remember, the actual System Path Variable to locate the bin directory, may not be the same in your system as the example I gave.
Hope this helps.
Plus I am sure this information is located somewhere in one of the forum's stickie read me files.
User avatar
shohreh
Posts: 4
Joined: Sun Apr 23, 2006 9:43 pm
Contact:

java.lang.NoClassDefFoundError

Post by shohreh »

I have entered in the run command C:\Program Files\Java\jre1.5.0_06\bin\java.exe
in the parameters I have entered $File
in the initial folder is entered C:Program Files\Java\jre1.5.0_6\bin
and I get this error java.lang.NoClassDefFoundError the address and Exception in thread "main". How do I correct this error. I have entered in the Path in evironment variables ;C:Program Files\Java\jdk1.5.0_06\bin
GPoker
Posts: 2
Joined: Fri Apr 20, 2007 12:57 pm

Post by GPoker »

I've got the same error.

But I'm using Update 11 instead of update 6.

Added C:\Program Files\Java\jdk1.5.0_11\bin to the Path.
And restarted the computer.

It works on command prompt, but it's still doesn't work on Textpad 4.7(other version have not checked).
Post Reply