Monday, December 2, 2013

Set Classpath while Compiling and Running java program




Compiling and running a java file in command line where it imports an external jar files. Here is the solution.

Compilation

javac -cp ; Example.java

run

java ; Example

Note 1:  separator ; for windows and : for unix
Note 2:  multiple jar files can be used delimited by ;
Note 3:  . can be used to specify the current directory





No comments:

Post a Comment