The Java-jar command is used to run a jar package recently, but the java. Lang. noclassdeffounderror exception is always thrown, but the relevant jar package has been put in the classpath, which cannot be understood. The command format is as follows: @ Echo off
Set project_home = E:/wingfeng/website/doimf
Set java_home = D:/Java/jdk1 . 5 . 0 _ 11
@ Set weblogic_home = G:/BEA/weblogic81/Server
Set ant_home = % Project_home %/webroot/WEB-INF/lib
Set thirdpart = % Project_home %/webroot/WEB-INF/lib
Set sqlt = E:/wingfeng/project/thridpath/sqlt
Set CP = . ; % Ant_home %/ant-launcher.jar; % ant_home %/ant-1.6.5.jar; % ant_home %/xalan. jar; % ant_home %/ant-junit.jar; % java_home %/lib/tools. jar; % thirdpart %/JUnit. jar; % ant_home %/ant-nodeps.jar; % ant_home %/ant-junit.jar; % thirdpart %/sqlprofiler. jar; % thirdpart %/p6spy. jar; % thirdpart %/irontracksql. jar
Java-classpath % CP %-jar % sqlt %/irontracksql. Jar
Later, after querying the information online, the following reasons were obtained:
First, jar is divided into executable jar and non-executable jar
An executable jar must be referenced by the menifest file header. If the-jar option is used, the environment variable classpath and all the class paths specified in the command line are ignored by JVM.(Http://www-128.ibm.com/developerworks/cn/java/j-jar/index.html) So the classpath I set is invalid.