Error message:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/launcher/Main
eclipse 文件夹底下找不到startup.jar, 没有startup.jar包。这可把我给郁闷了,因为我的程序偏偏要用到:
$ECLIPSE_JAVA_HOME/jre/bin/java -cp $ECLIPSE_HOME/startup.jar:$ECLIPSE_SHARED_HOME/plugins/org.junit_3.8.2.v20080602-1318/junit.jar org.eclipse.core.launcher.Main -application org.eclipse.ant.core.antRunner -buildfile $CONFIG_XML | tee $LOG/${config_no}.log
怎么办呢? 唉,果然是Eclipse newer,这都不懂,百度了半天没有收获,这才想起了,原来我也是懂英文的哦! Google一耙就找到了:
http://wiki.eclipse.org/Update_Site_Optimization
The org.eclipse.update.core bundle provides an application extension named org.eclipse.update.core.siteOptimizer which can be invoked from the command line.
java -jar /eclipse/startup.jar -application org.eclipse.update.core.siteOptimizer [options]
If your Eclipse installation does not contain startup.jar, use org.eclipse.equinox.launcher_version.jar from the plugins directory instead. The site optimizer application exposes the digest builder and the jar processor. The digest builder is the tool that creates the actual site digest, the jar processor is a tool that can repack, sign, pack or unpack a jar and all its nested jars recursively.
http://wiki.eclipse.org/Equinox_Launcher
There is no longer a startup.jar in the root of eclipse. This code has been moved to a plugin org.eclipse.equinox.launcher in the plugins directory. Eclipse can still be started directly with java using, for example:
java -jar plugins/org.eclipse.equinox.launcher_1.0.0.v20070208a.jar
It is also possible to copy this bundle into the root and name it startup.jar. In this case it would be possible to start with java -jar startup.jar.
my Eclipse version is 3.4
good!
通过仔细检查,还发现一个跟抓狂的问题:
export ECLIPSE_HOME=/home/tsadmin/elipse
export ECLIPSE_SHARED_HOME=/home/tsadmin/elipse
Eclipse拼写错误了,唉哦!
最后,程序写成这个就可以运行了a!
$ECLIPSE_JAVA_HOME/jre/bin/java -cp $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar:$ECLIPSE_SHARED_HOME/plugins/org.junit_3.8.2.v20080602-1318/junit.jar org.eclipse.core.launcher.Main -application org.eclipse.ant.core.antRunner -buildfile $CONFIG_XML | tee $LOG/${config_no}.log