Monday, 25 November 2013

Java - Compile Through Command Line

Java - Compile Through Command Line

Initially set your path with the syntax

set path=%path%;<path to java>

Mine was:
set path=%path%;"C:\Program Files\Java\jdk1.7.0_25\bin\"

then to compile the .java to a .class, you need to use javac

run:

javac <Java File>

Mine was:
javac SSLSocketClient.java

To Run the Application using terminal, use java (Leave out the .class in the file name)
java SSLSocketClient

Thanks to Kevin for helping me.

#bearMan