解决mvn compile [INFO] Compilation failure Unable to locate the Javac Compiler in:
2012-11-14 10:39
399 查看
报错时发现jdk的版本是openjdk
[xxxx default]$ java -version
java version "1.6.0_17"
OpenJDK Runtime Environment (IcedTea6 1.7.5) (rhel-1.16.b17.el5-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
需要切换成普通jdk
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
jdk切换方法如下:
安装在ubuntu10.10 系统下,开发环境需要,有时会需要安装JDK5和JDK6,怎么实现这两者之间的切换呢?使用update-alternativs 命令可以完成此任务
具体如下:
1. 查看相应的jdk是否在 ubuntu的jdk菜单里,查看:
update-alternatives --config java
update-alternatives --config javac
2.如果没有在菜单里可以如下方式添加:
update-alternatives --install /usr/bin/java java /usr/lib/jvm/java/jdk1.6.0_12/bin/java 300
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java/jdk1.6.0_12/bin/javac 300
注意:jdk1.6.0_12 版本不同会有变动
3.sudo update-alternatives --config java
sudo update-alternatives --config javac
选择序号,回车即可;
4.然后java -version,javac -version查看当前jdk版本
切换好以后,mvn compile,一切正常!
[xxxx default]$ java -version
java version "1.6.0_17"
OpenJDK Runtime Environment (IcedTea6 1.7.5) (rhel-1.16.b17.el5-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
需要切换成普通jdk
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
jdk切换方法如下:
安装在ubuntu10.10 系统下,开发环境需要,有时会需要安装JDK5和JDK6,怎么实现这两者之间的切换呢?使用update-alternativs 命令可以完成此任务
具体如下:
1. 查看相应的jdk是否在 ubuntu的jdk菜单里,查看:
update-alternatives --config java
update-alternatives --config javac
2.如果没有在菜单里可以如下方式添加:
update-alternatives --install /usr/bin/java java /usr/lib/jvm/java/jdk1.6.0_12/bin/java 300
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java/jdk1.6.0_12/bin/javac 300
注意:jdk1.6.0_12 版本不同会有变动
3.sudo update-alternatives --config java
sudo update-alternatives --config javac
选择序号,回车即可;
4.然后java -version,javac -version查看当前jdk版本
切换好以后,mvn compile,一切正常!
相关文章推荐
- Unable to locate the Javac Compiler in: C:Program FilesJavajre6..libtools.jar解决办法
- Maven出现 Unable to locate the Javac Compiler in解决方法
- Unable to locate the Javac Compiler in 错误的解决办法之一
- Maven出现 Unable to locate the Javac Compiler in解决方法
- m2e (maven eclipse) 在运行一些命令时出现了无法compile(Unable to locate the Javac Compiler in:)
- eclipse报错:Unable to locate the Javac Compiler in: C:Program FilesJavajre6..libtools.jar
- maven install Unable to locate the Javac Compiler in: C:\Program Files\Java\jre7\..\lib\tools.jar
- Maven打包异常Unable to locate the Javac Compiler in:Please ensure you are using JDK 1.4 or above and
- maven 报Unable to locate the Javac Compiler in: D:\Program Files\Java\jdk1.6.0_20\..\lib\tools.jar
- Unable to locate the Javac Compiler in:C:/Program Files/Java/jre1.5.0_22/../lib/tools.jar
- eclipse maven Unable to locate the Javac Compiler in:
- Unable to locate the Javac Compiler 解决办法
- 在使用eclipse 运行 maven install的时候,出现这个错误:Unable to locate the Javac Compiler in:…
- Eclipse: Problem: Unable to locate the Javac Compiler in...
- .[ERROR] Unable to locate the Javac Compiler in
- Maven: Unable to locate the Javac Compiler 解决办法
- maven报错:Unable to locate the Javac Compiler in: D:\Program Files\Java\jre7\..\lib\tools.jar
- win 10 mvn deploy报错:Unable to locate the Javac Compiler in
- Eclipse maven 打包出错 : COMPILATION ERROR Unable to locate the Javac Compiler
- Unable to locate the Javac Compiler 解决办法