问题:

[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files (x86)\Java\jre1.5.0_11\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.

网上有人说在eclipse.ini文件中设置

-vm
C:\Program Files\Java\jdk1.6.0_21\jre\bin\javaw.exe

或者

window-->preferences-->java-->Installed JREs:将路径设置成jdk的路径

这些方法都是影响这个ide环境的,更好的方法是针对项目进行修改:

最佳解决方案(我懒就不翻译了):

You can install as many different versions of Java — JREs and JDKs — as you like, and tell Eclipse which one to use for each project.

First step is to install the JDK 1.5 on your machine (JDK is short for 'Java [SE] Development Kit', look for that on the Oracle download site). The JDK includes a JRE, so to make life easier you can usually just install the JDK and not worry about the JRE/JDK distinction.

Second step is to tell Eclipse about the new JDK. Go to Preferences... then Java > Installed JREs. Click the Search... button and Eclipse should find your newly installed JDK 1.5 and add it to the list.

Final step is to allocate that JDK 1.5 to your project. Bring up the Properties menu for your project (right-click it). Then set these values:

  • Java Compiler tab

    • Tick Enable project specific settings
    • Set Compiler Compliance level to 1.5
  • Java Build Path tab, Libraries subtab
    • Find the JRE System Library item, click Edit...
    • Set Alternate JRE to your newly installed JDK 1.5

转载于:https://www.cnblogs.com/kinzhang/archive/2012/07/30/3048794.html

maven+eclipse编译常见问题相关推荐

  1. maven eclipse 编译错误 Dynamic Web Module 3.0 requires Java 1.6 or new

    新建项目出现 Dynamic Web Module 3.0 requires Java 1.6 or new 编译器的java版本不同导致 解决方法:pom添加 这段,eclpise 一下 <p ...

  2. 关于导入geoserver 源码到Eclipse编译运行

    参考http://blog.csdn.net/gisshixisheng/article/details/43016443 和  http://blog.sina.com.cn/s/blog_6e37 ...

  3. DICOM:dcm4che开源项目导入Eclipse编译错误问题解决方案

    背景: 马上跨年了,记得小时候元旦都不是事儿,怎么长大了长大了感觉越来越热闹了反而.各种饭局.各种party,有点hold不住.还是回来整理一下这一年的笔记比较舒服,比较有收获.看了看这个月竟然发文量 ...

  4. Eclipse编译运行Native代码步骤详解

    Eclipse编译运行Native代码步骤详解 标签: android jni层   android jni步骤   android jni接口   转自: http://blog.csdn.net/ ...

  5. maven项目编译漏掉src/main/java下的xml配置文件

    在整合Spring + Mybatis框架的时候,自动扫描配置都已经配置好了. 配置如下: <?xml version="1.0" encoding="UTF-8& ...

  6. Android之在eclipse编译项目出现unable to resolve target android-20解决办法

    1.问题 eclipse编译项目出现 unable to resolve target android-20 2.解决办法 在project.properties文件里面修改 target=andro ...

  7. maven 打包编译_您是否真的想加快Maven的编译/打包速度? 那么takari生命周期插件就是答案。...

    maven 打包编译 像你们中的许多人一样,我正在使用多模块Maven项目 . 与现有的许多系统相比,它不是一个巨大的系统,它具有15个模块,3种不同的耳朵部署,带有属性文件的大量参数化以及大约10万 ...

  8. IDEA解决Maven项目编译后classes文件中没有.xml或.properties问题

    IDEA解决Maven项目编译后classes文件中没有.xml或.properties问题 方式一.在 pom.xml 中添加下面的代码 <build><!--解决Maven项目编 ...

  9. 解决Maven打包(编译)慢的问题

    终于找到Maven打包(编译)慢的原因了,lombok是罪魁祸首 一个独立的Model包,560个实体类,编译要4分钟,而老项目2100多个类,编译才要10多秒 开始以为是Swagger注解的原因,最 ...

最新文章

  1. 力科示波器 matlab,力科周末文章四周年180期合集目录
  2. 百度2011招聘笔试题+答案解析
  3. 【ElasticSearch】Es 源码之 NodeClient 源码解读
  4. SAP License:ERP系统license过期了怎么办?
  5. FM算法及FFM算法
  6. python 截图 minicap_【Python】使用minicap对安卓手机快速截屏
  7. 160个crackme 008 Andrénalin.1
  8. 光伏发电matlab模块,光伏发电的matlab仿真.docx
  9. Matlab UIAxes中添加图例
  10. 高德地图 js自动定位到当前城市
  11. java获取其他应用程序的窗口控件
  12. 公司招了个漂亮女程序员是种什么样的体验?
  13. 距离除夕倒计时 距离2022年除夕还有多少天用便签计算
  14. 嵌入式开发要学习哪些知识
  15. bugzilla 删除bug
  16. sql-DbContext
  17. 基于tensorflow、CNN网络识别花卉的种类(图像识别)
  18. 常用端口与udp协议
  19. 《算法笔记》第三章3.2节、3.3节、3.4节学习笔记
  20. 神经网络中的BN操作(常见正则化处理)

热门文章

  1. minEnclosingCircle函数
  2. opencv Remap 图像的映射
  3. android 延迟2秒执行_每天30秒让你更懂汽车(10自动变速器2执行装置)
  4. 回溯法(深度优先搜索)
  5. pip安装时报错:以一种访问权限不允许的方式做了一个访问套接字的尝试
  6. CentOS7——vi编辑保存
  7. 20180925-4 单元测试,结对
  8. Python: sklearn库——数据预处理
  9. spring boot 开发 提交form表单出错
  10. BZOJ 3236[AHOI2013]作业