0% found this document useful (0 votes)
67 views

How To Setup Javac Command

To set up the javac command on Windows, you must: 1) Install the JDK and add its bin directory to the system PATH variable. 2) Create a Java file, compile it using javac, and run it using java to test if javac is configured correctly. 3) The javac command compiles Java files into class files while java runs already compiled class files.

Uploaded by

Mohammad Firdaus
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

How To Setup Javac Command

To set up the javac command on Windows, you must: 1) Install the JDK and add its bin directory to the system PATH variable. 2) Create a Java file, compile it using javac, and run it using java to test if javac is configured correctly. 3) The javac command compiles Java files into class files while java runs already compiled class files.

Uploaded by

Mohammad Firdaus
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

How to setup javac command

Credit to http://www.skylit.com/javamethods/faqs/javaindos.html
by Fir09 :D

1st make sure you already have install jdk Open control panel -> System -> Advance system setting

by Fir09 :D

Then click Environment Variables

by Fir09 :D

At System variables, click Path and click Edit

by Fir09 :D

you have to be very careful because your system might crash if you make a mistake. Proceed with extreme caution! At the end in the text box of Variable value, add path of your installed jdk, for example ;C:\Program Files\Java\jdk1.7.0\bin. Depend on jdk version you install. For more safe, browse your jdk first[by default in C:\Program Files\Java\jdk1.7.0\bin] and copy the path.

by Fir09 :D

Then just click OK and OK and OK.. Hehe To test javac. 1st create your java folder in C:

by Fir09 :D

Open notepad, create a simple java file like this:

Then, save as HelloWorld.java in your java folder


by Fir09 :D

Then open command prompt (cmd) Go to your java directory, type cd C:\myJava

by Fir09 :D

Type javac HelloWorld.java this will compile your java. If nothing happens means no error. You should see HelloWorld.class in your folder

by Fir09 :D

To run HelloWorld.java file, type : java HelloWorld You should get output : Hello, World!

by Fir09 :D

The END

Note: javac is use to compile. you also can use other software like kawa or bluej to compile your java file. Tq.

by Fir09 :D

You might also like