Commands
1.Compile Java Class depends on JarSuppose library name is library.jar and class name MyClass.java then follow the command like as follows :
javac -cp library.jar MyClass.java
2.Execute Java Class depends on Jar
java -cp library.jar:. MyClass
To specify in the class path that you want to use the JAR dependency AND the current local directory to resolve classes.
On Windows, replace
:
by ;
:java -cp library.jar;. MyClass
Comments
Post a Comment