java -Djava.ext.dirs={lib}

If U are in a hurry to compile code and there is a big list of Jar files to include in the classpath, there U don't have to struggle to include the names of all the jar's in the classpath.

There is a neat trick - use the "java.ext.dirs" JVM param to point to the directory containing the jar files.

java -Djava.ext.dirs=c:\java\axis-1_1\lib -classpath classes MyJavaClass

或者
设置环境变量
变量名lib
变量值c:\java\axis-1_1\lib
java -Djava.ext.dirs=%lib% -classpath classes MyJavaClass

你可能感兴趣的:(java,jvm,C++,c,ext)