If you simply want to compile or run Java applications from command line, you can just add the jars to the classpath:
When running a java application, you have to add the classes folder as well
When running from command prompt on windows, you can also replace "bin" with a "."
Note that under *nix OS not a semicolon(;), but a colon(:) is used to separate classpath parts.
Reference:
1. http://www.coderanch.com/t/423052/java/java/solved-add-external-jar-windows
javac -classpath c:\path1\ext1.jar;d:\path2\ext2.jar de\example\MyClass.java
When running a java application, you have to add the classes folder as well
java -classpath bin;c:\path1\ext1.jar;d:\path2\ext2.jar de.example.MyClass
When running from command prompt on windows, you can also replace "bin" with a "."
Note that under *nix OS not a semicolon(;), but a colon(:) is used to separate classpath parts.
Reference:
1. http://www.coderanch.com/t/423052/java/java/solved-add-external-jar-windows
No comments:
Post a Comment