2014-11-16:How to run java project(containing several package) in linux

items

  • lib: some file end by .jar
  • sources: *.java
  • executable file: *.class

run the executable file

If the source files have been executed, just run with lib:

java -cp /home/username/.../lib/libfile1.jar:/home/username/.../lib/libfile2.jar:  packageDir.Test

compiling source files

javac -cp /home/username/.../lib/libfileq.jar:/home/username/.../lib/libfile2.jar: Test.java

Don't ignore the last ':' following *.jar, and there are not any blank before ':'**
Otherwise , some errors will occur.

原文地址:https://www.cnblogs.com/cyno/p/4124927.html