在 CentOS 上使用 Xvfb 运行 GWT Devmode
我正在尝试使用 Xvfb 在 CentOS 上使用 Ant 运行 GWT Devmode,但收到似乎是 Java 版本错误的信息。堆栈跟踪的开头是
[java] JVM args ignored when same JVM is used
[java] Working directory ignored when same JVM is used.
[java] java.lang.NoClassDefFoundError: java.util.concurrent.Semaphore
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.taskdefs.Java.run(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.taskdefs.Java.execute(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.UnknownElement.execute(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Task.perform(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Target.execute(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Target.performTasks(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Project.executeSortedTargets(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Project.executeTarget(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Project.executeTargets(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Main.runBuild(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Main.startAnt(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.6.5.jar.so)
[java] at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.6.5.jar.so)
[java] Caused by: java.lang.NoClassDefFoundError: java.util.concurrent.Semaphore
[java] at com.google.gwt.dev.DevModeBase.<init>(DevModeBase.java:749)
[java] at com.google.gwt.dev.DevMode.<init>(DevMode.java:341)
[java] at com.google.gwt.dev.DevMode.main(DevMode.java:309)
[java] at java.lang.reflect.Method.invoke(libgcj.so.7rh)
我安装了Sun的java 1.7.0,我认为它设置正确。当我执行“java -version”和执行“alternatives --config java”(版本 1.4.2 设置为默认版本,但我更改了当前版本)时,它会显示。
这是我正在运行的蚂蚁任务。请注意,我已经尝试了 fork="true|false" 和 spawn="true|false" 的所有组合,
<target name="devmode" depends="" description="Run development mode">
<java fork="true" classname="com.google.gwt.dev.DevMode"
dir="${basedir}/war" spawn="true">
<classpath>
<pathelement location="src" />
<path refid="project.class.path" />
<path refid="tools.class.path" />
</classpath>
<jvmarg value="-Xmx512M" />
<jvmarg value="-javaagent:${appengine.folder}/lib/agent/appengine-agent.jar" />
<jvmarg value="-Duser.dir=${basedir}/war" />
<arg line="-war" />
<arg value="${basedir}/war" />
<arg line="-logLevel" />
<arg value="INFO" />
<arg value="-server" />
<arg value="com.google.appengine.tools.development.gwt.AppEngineLauncher" />
<arg value="net.bookedin.bam.BAM" />
</java>
</target>
我的 $CLASSPATH 变量(假设很重要)显示: /usr/java/jdk1.7.0_02/lib
I'm trying to run GWT Devmode with Ant on CentOS using Xvfb and I'm getting what appears to be a Java version error. The beginning of the stacktrace is
[java] JVM args ignored when same JVM is used
[java] Working directory ignored when same JVM is used.
[java] java.lang.NoClassDefFoundError: java.util.concurrent.Semaphore
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.taskdefs.Java.run(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.taskdefs.Java.execute(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.UnknownElement.execute(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Task.perform(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Target.execute(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Target.performTasks(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Project.executeSortedTargets(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Project.executeTarget(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Project.executeTargets(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Main.runBuild(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.Main.startAnt(ant-1.6.5.jar.so)
[java] at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.6.5.jar.so)
[java] at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.6.5.jar.so)
[java] Caused by: java.lang.NoClassDefFoundError: java.util.concurrent.Semaphore
[java] at com.google.gwt.dev.DevModeBase.<init>(DevModeBase.java:749)
[java] at com.google.gwt.dev.DevMode.<init>(DevMode.java:341)
[java] at com.google.gwt.dev.DevMode.main(DevMode.java:309)
[java] at java.lang.reflect.Method.invoke(libgcj.so.7rh)
I installed Sun's java 1.7.0 and I think it's set properly. It shows up when I do "java -version" and when I do "alternatives --config java" (version 1.4.2 is set as the default but I've changed the current version).
This is the ant task I'm running. Note that I've tried all combinations of fork="true|false" and spawn="true|false"
<target name="devmode" depends="" description="Run development mode">
<java fork="true" classname="com.google.gwt.dev.DevMode"
dir="${basedir}/war" spawn="true">
<classpath>
<pathelement location="src" />
<path refid="project.class.path" />
<path refid="tools.class.path" />
</classpath>
<jvmarg value="-Xmx512M" />
<jvmarg value="-javaagent:${appengine.folder}/lib/agent/appengine-agent.jar" />
<jvmarg value="-Duser.dir=${basedir}/war" />
<arg line="-war" />
<arg value="${basedir}/war" />
<arg line="-logLevel" />
<arg value="INFO" />
<arg value="-server" />
<arg value="com.google.appengine.tools.development.gwt.AppEngineLauncher" />
<arg value="net.bookedin.bam.BAM" />
</java>
</target>
My $CLASSPATH variable (assuming that matters) shows: /usr/java/jdk1.7.0_02/lib
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现了问题。虽然我已将 java 更新到 1.7.0,但 javac 仍然指向旧的 1.4.2 版本。我使用替代方法来安装新版本并切换到它:
Discovered the problem. While I had updated java to 1.7.0, javac was still pointing to the old 1.4.2 version. I used alternatives to install the new version and switch to it: