Eclipse is running in a JRE, but a JDK is required

安装Maven后每次启动出现警告信息:
    Eclipse is running in a JRE, but a JDK is required.
    Some Maven plugins may not work when importing projects or updating source folders.

分两步解决问题:

1. 检查Eclipse正在使用的JRE

‘Window’ -> ‘Preferences’ -> ‘Java’ -> ‘Installed JREs’ 确定正在使用JDK而非JRE.

如果没有JDK, 则先新增一个Standard VM.

2. 配置Eclipse.ini

检查Eclipse配置文件, 增加/编辑以下代码:

  1. -vm
  2. C:\Progra~2\Java\jdk1.6.0_16\jre\bin\javaw

注意事项:

1. 第一行参数名称, 第二行为值, 不能写到同一行中

2. 关于第二行的值, 因为不允许出现空格, 所以使用Progra~1或2 替代”Program Files (x86)”.
如果在Program Files下, 请使用Progra~1, 如果在x86下, 则使用Progra~2

3. 在文件中的位置, 不能放到最后(不能在-vmargs之后), 不放心的直接放到文件最前, 如:

  1. -vm
  2. C:\Progra~2\Java\jdk1.6.0_16\jre\bin\javaw
  3. -startup
  4. .....
  5. --launcher.defaultAction
  6. openFile
  7. -vmargs
  8. -Dosgi.requiredJavaVersion=1.5
  9. -Xms240m
  10. -Xmx912m

3. 重启Eclipse, 警告不再出现.

可能抛出的异常
1.如果启动eclipse.exe时抛出异常java was started but returned exit code =13如下:

其是由eclipse的版本与jdk的版本不一致引起的,要确保eclipse与jdk要么都是64位的,要么是32位的。

2.如果启动eclipse.exe时抛出异常java was started but returned exit code =-805306369
这个错误原因可能有很多,我这只是一只可能的解决方法,如下:主要原因是eclipse.ini配置文件错误了,配置文件中-vm参数设置错误,在windows7系统下需要使用 " / " 而不是 " \ "

3.如果启动eclipse.exe时抛出异常java was started but returned exit code =1
Eclipse
is using the system default JRE that it finds in the windows system
folders. You should point it to a JDK installation using eclipse.ini (as
described here: http://wiki.eclipse.org/Eclipse.ini )”,大意是Eclipse启动的时候默认会使用从windows系统目录下找到的JRE作为默认的环境,由于我之前升级安装了一下JDK,所以系统目录下的JRE和实际的Java安装是不匹配的,因此会出现运行Eclipse时报错的情况,所以需要手动修改一下-VM 参数,再启动。

Eclipse is running in a JRE, but a JDK is required

时间: 2024-10-29 05:40:11

Eclipse is running in a JRE, but a JDK is required的相关文章

Eclipse is running in a JRE, but a JDK is required 解决方法

本文非原创,转自http://liguoliang.com/2010/eclipse-is-running-in-a-jre-but-a-jdk-is-required/ 安装Maven后每次启动出现警告信息: Eclipse is running in a JRE, but a JDK is required Some Maven plugins may not work when importing projects or updating source folders. 分两步解决问题:

Eclipse is running in a JRE, but a JDK is required Some Maven plugins may not work when importing projects or updating source folders.

安装Maven后每次启动出现警告信息: Eclipse is running in a JRE, but a JDK is requiredSome Maven plugins may not work when importing projects or updating source folders. 分两步解决问题: 1. 检查Eclipse正在使用的JRE 'Window' -> 'Preferences' -> 'Java' -> 'Installed JREs' 确定正在使用

Eclipse解决方案之"Eclipse is running in a JRE, but a JDK is required"

Open the eclipse folder and edit the eclipse.ini file: Please check if the file has the -vm parameter, if not, then add it. -vm C:\Program Files\Java\jdk1.6.0_10\bin\javaw.exe Note: It should be add before the -vmargs parameter. See my eclipse.ini, j

Maven编译失败,提示No compiler is provided in this enviroment. Perhaps you are running on a JRE rathen a JDK ?

用maven对项目进行构建时,提示No compiler is provided in this enviroment. Perhaps you are running on a JRE rathen a JDK ?错误,如下图 出现此错,只需要将JRE home指定为jdk(jdk目录本身自带jre)安装目录,再次用maven构建项目即可,如下图示 更为详细的步骤可以参考如下博客:https://blog.csdn.net/lslk9898/article/details/73836745 原

[转]在Eclipse整合Maven3.6.3插件导入maven项目并编译时,控制台提示No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

近日有同事遇到在编译Maven项目时出现[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?的问题, 原以为这是个个例, 源于同事粗心, 配置环境出问题造成, 后到百度查看一下, 遇到这个问题的不在少数, 但是对问题的解释没有说到根源, 于是写下这篇博客供大家参阅, 如有纰漏, 还请指正.错误代码节选: [ERROR] COMPILATION

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

控制台输出的错误信息如下: [INFO] Scanning for projects... [INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 [INFO] [INFO] ----------------------------------------------------

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 问题

maven编译项目时出错,提示信息如下: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1: Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 在Eclipse的菜单中,进入 Windo

attempting to bokeyaunrun eclipse useing the jre instead of jdk,to run eclipse using

关于eclipse运行出现,attempting to bokeyaunrun eclipse useing the jre instead of jdk,to run eclipse using错误的解决方案“ Incorrect path to your JDK When you install the Java JDK from Oracle (1.6 or 1.7), by default, it installs both the JDK and the JRE. If it inst

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a...

使用Maven中的maven-build来本地调试项目,启动后在console出现如下错误信息 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)on project XXXX: Compilation failure [ERROR] No compiler is provided in this environment. Perha