plz tell me how we compile java program
Printable View
plz tell me how we compile java program
You have to first navigate to C:\jdk\1.3 to run the compiler and interpreter unless you set it to be otherwise.
To compile from DOS -> C:\jdk1.3\bin> javac C:\YourDirectory\App.java
To run -> C:\jdk1.3\bin> java -classpath C:\YourDirectory; App
If you have the CLASSPATH variable set in the autoexec.bat then you can just omit the -classpath switch.
Also, If you add this line 'c:\jdk1.3\bin;' to the 'path' line in your autoexe.bat file (located on the c: drive) then all you have to do is go to C: in the command prompt, and type autoexec. Then you can use your compiler program (javac) anywhere.
Is there an echo in here? :confused: