maven+eclipse编译常见问题
2012-07-30 17:46
169 查看
问题:
网上有人说在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
[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
相关文章推荐
- [转载] Eclipse反编译插件 Jodeclipse与JadClipse 与 常见问题解决方法
- eclipse常见问题 -- 编译方面
- linux编译中的常见问题
- Maven+SSM整合在Eclipse中不能编译的问题
- eclipse,sts等IDE开发web项目不编译代码的问题
- Eclipse Java环境修复指南,Eclipse 常见小问题
- maven编译问题:maven编译成功,eclipse文件未编译
- 解决Eclipse无法正常编译的问题
- eclipse下svn常见问题
- Eclipse 转Android Studio 常见问题小结
- axis1-myeclipse/eclipse-入门级别-资源、流程、常见问题
- linux2.6驱动编译-常见问题
- [Android开发常见问题-2] eclipse安装/卸载svn插件
- 【IOS】工程编译中常见问题
- Linux下常见的编译问题
- 编译安装apache,常见问题整理
- eclipse使用及常见问题解决
- Gradle编译java,Eclipse项目以及遇到的问题
- eclipse 远程图形化调试嵌入式linux c arm(beaglebone black),解决常见调试问题
- vxworks编译时常见的问题分析