当前位置: 首页 > 知识库问答 >
问题:

无法在Eclipse中运行Ant Build

印高阳
2023-03-14

我的蚂蚁模型最近某个时候停止工作了。我不知道确切的时间,因为我只是偶尔在这个项目中进行ant构建。我得到以下弹出窗口:

错误仅适用于此项目。我可以从另一个项目运行构建没有问题。

build.xml文件可能非常简单,但仍然会导致错误:

<project basedir=".">
    <target name="init">
    </target>
</project>

我检查了Eclipse的日志,发现了以下错误:

!SESSION 2020-10-15 04:24:23.311 -----------------------------------------------
eclipse.buildId=4.17.0.I20200902-1800
java.version=13.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.jface 2 0 2020-10-15 04:24:25.323
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2020-10-15 04:24:25.323
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
  ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
    Open a type in a Java editor,
    Category(org.eclipse.ui.category.navigate,Navigate,null,true),
    org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5f67181f,
    ,,true),null),
  org.eclipse.ui.defaultAcceleratorConfiguration,
  org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
  ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
    ,
    Category(org.eclipse.lsp4e.category,Language Servers,null,true),
    org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1169fdfd,
    ,,true),null),
  org.eclipse.ui.defaultAcceleratorConfiguration,
  org.eclipse.ui.contexts.window,,,system)

!ENTRY org.eclipse.e4.ui.workbench 4 0 2020-10-15 04:24:27.543
!MESSAGE Unable to retrieve the bundle from the URI: bundleclass://org.eclipse.recommenders.news.rcp/org.eclipse.recommenders.internal.news.rcp.toolbar.NewsToolControl

!ENTRY org.eclipse.egit.ui 2 0 2020-10-15 04:24:28.090
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Joshua'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

    !ENTRY org.eclipse.ant.launching 4 120 2020-10-15 04:24:37.887
    !MESSAGE Error logged from Ant UI: 
    !STACK 0
    java.net.SocketException: Socket closed
      at java.base/sun.nio.ch.NioSocketImpl.endAccept(NioSocketImpl.java:689)
      at java.base/sun.nio.ch.NioSocketImpl.accept(NioSocketImpl.java:762)
      at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:662)
      at java.base/java.net.ServerSocket.platformImplAccept(ServerSocket.java:628)
      at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:604)
      at java.base/java.net.ServerSocket.implAccept(ServerSocket.java:561)
      at java.base/java.net.ServerSocket.accept(ServerSocket.java:518)
      at org.eclipse.ant.internal.launching.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:91)

    !ENTRY org.eclipse.core.jobs 4 2 2020-10-15 04:24:37.888
    !MESSAGE An internal error occurred during: "Launching Hypnos build.xml".
    !STACK 0
    java.lang.NullPointerException
      at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.getBootpathExt(AbstractJavaLaunchConfigurationDelegate.java:364)
      at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.getVMSpecificAttributesMap(AbstractJavaLaunchConfigurationDelegate.java:679)
      at org.eclipse.jdt.launching.JavaLaunchDelegate.getVMRunnerConfiguration(JavaLaunchDelegate.java:92)
      at org.eclipse.jdt.launching.JavaLaunchDelegate.launch(JavaLaunchDelegate.java:160)
      at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate.runInSeparateVM(AntLaunchDelegate.java:580)
      at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate.launch(AntLaunchDelegate.java:251)
      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:807)
      at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:718)
      at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1021)
      at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1224)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

我使用的是Eclipse 2020-06。我尝试升级到Eclipse 2020-09来解决这个问题,但没有成功。

根据eclipse的JVM是eclipse。vm=C:\java\jdk-13.0.1\bin\server\jvm。dll

该java文件夹中的释放文件说:

BUILD_TYPE="commercial"
IMPLEMENTOR="Oracle Corporation"
JAVA_VERSION="13.0.1"
JAVA_VERSION_DATE="2019-10-15"
MODULES="java.base java.compiler java.datatransfer java.xml java.prefs java.desktop java.instrument java.logging java.management java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.transaction.xa java.sql java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.vm.ci jdk.management jdk.unsupported jdk.internal.vm.compiler jdk.aot jdk.internal.jvmstat jdk.attach jdk.charsets jdk.compiler jdk.crypto.ec jdk.crypto.cryptoki jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.hotspot.agent jdk.httpserver jdk.internal.le jdk.internal.opt jdk.internal.vm.compiler.management jdk.jartool jdk.javadoc jdk.jcmd jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jfr jdk.jlink jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.rmi jdk.net jdk.pack jdk.rmic jdk.scripting.nashorn jdk.scripting.nashorn.shell jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported.desktop jdk.xml.dom jdk.zipfs"
OS_ARCH="x86_64"
OS_NAME="Windows"
SOURCE=".:hg:b06ae01c3eea open:hg:8d03d066c4e8"

知道如何解决这个问题吗?

共有2个答案

羊舌承
2023-03-14

在将Eclipse升级到2022-03之后,我遇到了类似的错误。Ant不会运行,但没有显示错误。然后我注意到了java。网SocketException:工作区日志中出现套接字关闭错误。

只有当我使用最新的Java版本,但需要使用JDK 1.8时,才能按照另一个答案的建议更改JRE。由于我无法解决这个问题,我只是将Eclipse降级到2021至2012年。

显然,在未来的版本中,至少需要Java11来运行Ant:https://bugs.eclipse.org/bugs/show_bug.cgi?id=579317

董凡
2023-03-14

这似乎与用于运行Ant脚本的Java有关。

在运行配置中,在JRE选项卡中,确保选择了JRE/JDK(对于现有的Ant运行配置,由于首选项的更改,可能会丢失先前选择的JRE/JDKJava

 类似资料:
  • 我正在学习静态编程语言,所以我创建了一个带有main方法的文件,里面有简单的println方法调用,然后按下运行为静态编程语言应用程序,得到了异常错误:无法找到或加载主类learn.varabls.变量Kt-1/>ClassNotFoundExc0019:learn.varabls.变量Kt错误:无法找到或加载主类Kt导致:java.lang.ClassNotFoundExc0019: Kt

  • 我试图在eclipse IDE的kotlin中启动新项目,我成功安装了kotlin,并且使用命令行我可以编译和运行kotlin文件。 但是在eclipse中我有一个错误: 我尝试设置新项目 将文件设置为“kotlin文件”和“kotlin类” Eclipse: Oxygen.3a Release(4.7.3a) java: java 10.0.1 2018-04-17Java(TM)SE运行时环境

  • 问题内容: 我当时在做一个Android项目,重新启动计算机后,eclipse将无法运行。它引发.metadata.log文件错误。 问题答案: 尝试使用新的工作区。要强制工作区窗口提示,您需要在中更改设置并将其设置为。

  • 问题内容: 我在oracle站点上找到了此代码,但是我无法使用Eclipse启动,这是说“无法启动”。我已经安装了JDK 8,但是它不起作用… 有人有解决办法吗?:p 链接到找到代码的网站:https : //docs.oracle.com/javafx/8/embed_swing/jfxpub- embed_swing.htm 问题答案: 在Java 8中,即使没有方法,您也可以直接启动子类。问

  • 我遵循了这些指示。这就是JDK和JavaFX的位置: VM参数为: 请帮助识别和整改问题。(我尝试了以下建议的几种方法,但似乎没有任何效果。)

  • 我在这里的问题中遇到了同样的问题:Tomcat在eclipse中启动,但无法连接到http://localhost:8085/,这意味着我无法在浏览器上打开http://localhost:8080/: 我使用的是Tomcat 7.0.27、Eclipse Europa和Java1.6.0_32。我看到了Balusc的答案,但问题是我无法选择Tomcat安装(下图)。 这里会出什么问题? PS:似