解决Perhaps you are running on a JRE rather than a JDK?问题
2015-11-28 17:57
417 查看
转自:http://www.bubuko.com/infodetail-743907.html
Maven-No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ helloworld ---
[INFO] Deleting H:\mavenok\helloworld\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
[INFO] Using ‘UTF-8‘ encoding to copy filtered resources.
[INFO] skip non existing
resourceDirectory H:\mavenok\helloworld\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to H:\mavenok\helloworld\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.781 s
[INFO] Finished at: 2015-03-25T11:22:14+08:00
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project helloworld: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to
enable full debug logging.
[ERROR]
[ERROR] For more information
about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
问题描述:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
翻译过来就是,大哥,环境里没给编译器呀,可能你是用jre在玩耍,我要jdk~~
问题原因:eclipse官网看了看,发现eclipse默认是运行在jre上的,
但是maven插件需要使用jdk,因此需要在eclipse修改Installed
JRES
位置在-->【Window】-->【Prefrences】-->【Java】-->【Installed JREs】
详见下图。
这样就解决了这个问题,重新构建一下
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ helloworld ---
[INFO] Deleting H:\mavenok\helloworld\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
[INFO] Using ‘UTF-8‘ encoding to copy filtered resources.
[INFO] skip non existing
resourceDirectory H:\mavenok\helloworld\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to H:\mavenok\helloworld\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.117 s
[INFO] Finished at: 2015-03-25T11:45:51+08:00
[INFO] Final Memory: 6M/12M
[INFO] ------------------------------------------------------------------------
构建成功。
参考自:/article/5595334.html
对于m2eclipse的插件,需要eclipse运行于jdk而不是jre, 打开eclipse,看到错误“Eclipse is running in a JRE, but a JDK is required”
解决方法:
在eclipse目录下eclipse.ini,添加如下两行,注意这行要加在-vmargs之前,
-vm
D:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe
比如我的文件如下:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
D:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe
-vmargs
-Xms40m
-Xmx512m
执行了Run as-run configrations
发现这个里面的runtime jre竟然还是设置在Alternate JRE上面,把它设置到Workspace default JRE上就可以了。
Maven-No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ helloworld ---
[INFO] Deleting H:\mavenok\helloworld\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
[INFO] Using ‘UTF-8‘ encoding to copy filtered resources.
[INFO] skip non existing
resourceDirectory H:\mavenok\helloworld\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to H:\mavenok\helloworld\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.781 s
[INFO] Finished at: 2015-03-25T11:22:14+08:00
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project helloworld: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to
enable full debug logging.
[ERROR]
[ERROR] For more information
about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
问题描述:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
翻译过来就是,大哥,环境里没给编译器呀,可能你是用jre在玩耍,我要jdk~~
问题原因:eclipse官网看了看,发现eclipse默认是运行在jre上的,
但是maven插件需要使用jdk,因此需要在eclipse修改Installed
JRES
位置在-->【Window】-->【Prefrences】-->【Java】-->【Installed JREs】
详见下图。
这样就解决了这个问题,重新构建一下
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ helloworld ---
[INFO] Deleting H:\mavenok\helloworld\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
[INFO] Using ‘UTF-8‘ encoding to copy filtered resources.
[INFO] skip non existing
resourceDirectory H:\mavenok\helloworld\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to H:\mavenok\helloworld\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.117 s
[INFO] Finished at: 2015-03-25T11:45:51+08:00
[INFO] Final Memory: 6M/12M
[INFO] ------------------------------------------------------------------------
构建成功。
安装Maven后,提示“Eclipse is running in a JRE, but a JDK is required”的解决方法
参考自:/article/5595334.html对于m2eclipse的插件,需要eclipse运行于jdk而不是jre, 打开eclipse,看到错误“Eclipse is running in a JRE, but a JDK is required”
解决方法:
在eclipse目录下eclipse.ini,添加如下两行,注意这行要加在-vmargs之前,
-vm
D:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe
比如我的文件如下:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
D:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe
-vmargs
-Xms40m
-Xmx512m
执行了Run as-run configrations
发现这个里面的runtime jre竟然还是设置在Alternate JRE上面,把它设置到Workspace default JRE上就可以了。
相关文章推荐
- ----基础总结----
- JDK 和 JRE 的配置 。
- java 集合 有一个字符串,其中包含中文字符、英文字符和数字字符,请统计和打印出各个字符的个数
- Spring 的扩展机制测试
- 夯实JAVA基本之二 —— 反射(2):泛型相关周边信息获取
- java 集合 从类似如下的文本文件中读取出所有的姓名,并打印出重复的 * 姓名和重复的次数,并按重复次数排序:
- 如何加快Eclipse的启动速度?
- eclipse不能修改dynamic web module version的解决办法
- 七牛CDN部分JAVA使用教程
- SpringMVC的各种参数绑定方式
- Java数组初始化与内存控制
- java反射机制(1)- 知识点总结Java Reflection API操作
- Spring4.2.0设计思想---总体架构
- myeclipse 没有提示时的设置
- JDK切换版本
- 多线程之:java线程创建
- 关于java中==号的一点了解
- java基础阶段总结
- 我的第六个java程序 spring-bean
- Java虚拟机运行时数据区