I want to write java programs on my computer, and I was able to get the .java extension to work using notepad (and my computer recognized it as a java file) but when i tried to compile it in the command prompt it didn’t work. Any ideas?
I have jdk, but I can't find javac.exe. I just re dl'd it and can't find it.
Related posts:








3 responses so far ↓
1 Ahmed The Ninja // Oct 7, 2008
You need a compiler and a virtual machine to compile and run java code.
2 Mercuri // Oct 7, 2008
The whole point of Java is that it requires a Java Virtual Machine (JRE) to run. On top of that, you need to compile the .java files into .class files to be able to execute them.
3 Haagendasz // Oct 7, 2008
Presuming you have the jdk installed, ensure that the path variable points to the directory where you have the “javac.exe” file.
To set the path variable, go to control panel->system->advanced->environment variables->system variables->look for path (hit edit and add path to javac.exe). Restart your PC.
Once you set this, it is a matter of compiling it like “javac yourfile.java” on the command prompt.
Leave a Comment