maven+eclipse编译常见问题
問題:
?
[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.
網(wǎng)上有人說在eclipse.ini文件中設(shè)置
?
?
-vm
C:\Program Files\Java\jdk1.6.0_21\jre\bin\javaw.exe
或者
window-->preferences-->java-->Installed JREs:將路徑設(shè)置成jdk的路徑
這些方法都是影響這個(gè)ide環(huán)境的,更好的方法是針對(duì)項(xiàng)目進(jìn)行修改:
最佳解決方案(我懶就不翻譯了):
?
?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
?
轉(zhuǎn)載于:https://www.cnblogs.com/kinzhang/archive/2012/07/30/3048794.html
總結(jié)
以上是生活随笔為你收集整理的maven+eclipse编译常见问题的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: hlp文件怎么打开 打开HLP文件的方法
- 下一篇: HDU hdu 2094 产生冠军 拓