Computing.Net > Forums > Programming > Error when compiling java files!!?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Error when compiling java files!!?

Reply to Message Icon

Name: Dado
Date: August 15, 2004 at 16:30:19 Pacific
OS: Win XP
CPU/Ram: 512MB
Comment:

I installed Java Runtime Environment 1.4.2 and created my java file (.java), but when I want to compile it in command promt I get an error message: 'javac' is not recognized as an interneal or external command, operable program or batch file. Does anyone know why this happens? Help appreciated!



Sponsored Link
Ads by Google

Response Number 1
Name: BlueRaja
Date: August 15, 2004 at 19:13:40 Pacific
Reply:

Never used it, but:
1. Make sure you're in the correct directory (the directory javac.exe is in, you could search for it through Windows)
2. You installed Java Runtime Environment...I'd imagine that you'd need the SDK to compile code.


0

Response Number 2
Name: Tugg
Date: August 16, 2004 at 10:23:39 Pacific
Reply:

Greetz Dado.

To get the compiler to work you have to add the path to the compiler (javac.exe) in your 'Environmental Variables' under Control Panel->System.
Under WinXP search in bottom window for something labeled 'Path'.
Double click and than at the end past the path to your compiler. Than reboot your comp and try again. Should work

Hope it helps
Cheers
~TuGG*


0

Response Number 3
Name: DarkIce
Date: August 17, 2004 at 06:43:10 Pacific
Reply:

Get the SDK (software development kit) from java.sun.com
https://jsecom16.sun.com/ECom/EComActionServlet;jsessionid=jsecom16.sun.com-13396%3A41220d25%3A95a5f5e1ffee20b9
(i'd also recommend the ide JCreator)


0

Response Number 4
Name: Dado
Date: August 18, 2004 at 19:12:30 Pacific
Reply:

I know in what directory javac.exe is located, but I do not understand how to add the path as Tugg said to the Win XP!? I cannot find under Control Panel/System anything labeled 'Path'. Does anyone know where this might be?


0

Response Number 5
Name: Tugg
Date: August 19, 2004 at 00:33:05 Pacific
Reply:

Sorry if i wasnt very clear on setting the path. If you just want to use the compiler as in the SDK than you must go to Control Panel -> System -> Advanced tab. At the bottem of the window you'll see a button called environmental variables. Click on that and you will find the path at the bottom of the new window.

Like DarkIce said, I'd also recommend getting JCreator Lite as well. Its a free IDE and you wont have to set the Environmental Variables to use it. It has lots of neat features too and will be a big help in organizing your code and your source files.

Cheers
~TuGG~


0

Related Posts

See More



Response Number 6
Name: Dado
Date: August 19, 2004 at 12:11:02 Pacific
Reply:

Thanks, I installed JCreator and it compiles and executes java files without problems. Now I do not need to go to set the path manually since I'll use this software to edit my files and while I'm there, I can also execute and debug them. Thanks again!


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Error when compiling java files!!?

Run and compile Java file in VB6? www.computing.net/answers/programming/run-and-compile-java-file-in-vb6/15563.html

Urgent!!!can't compile *.java file(rev.) www.computing.net/answers/programming/urgentcant-compile-java-filerev/227.html

Having problem compiling my java file www.computing.net/answers/programming/having-problem-compiling-my-java-file/2391.html