Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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!

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.

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 workHope it helps
Cheers
~TuGG*

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)

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?

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~

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!

![]() |
![]() |
![]() |

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