eclipse运行build报错Error: A JNI error has occurred, please check your installation and try again

本文详细介绍了如何在Windows环境下配置Eclipse使用特定版本的JRE。首先通过perferences->java->InstalledJREs选择系统JDK的jre文件夹。然后在.eclipse目录下编辑launch配置文件,例如ngb.processbuild.xml,确保VM_INSTALL_NAME配置为不带版本号的jre名称。该过程对于正确运行Java项目至关重要。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、进入windows==>perferences==>java==>Installed JREs
选择系统JDK中的jre文件夹
2、进入eclipse文件:.metadata\.plugins\org.eclipse.debug.core\.launches
打开对应的文件,例如:ngb.process build.xml
以下配置为准,其中VM_INSTALL_NAME对应的jre,不要带版本号(jre-1.8.291)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
    <booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"/>
    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"/>
    <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
    <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/>
    <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ngb.process"/>
    <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
    <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="jre"/>
    <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>
    <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/ngb.process/build.xml}"/>
    <stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
</launchConfiguration>
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值