hugh 的个人博客

ubuntu下执行javac失败

1、失败症状

BUILD FAILED
/home/hugh/runjs/RunJS/RunJS/build.xml:25: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

2、解决方案

执行 (可省)

sudo update-java-alternatives -s java-1.7.0-openjdk-amd64

java-1.7.0-openjdk-amd64  指你在/usr/lib/jvm下安装的java对应版本

执行 javac 提示需要安装 jdk

apt-get install openjdk-7-jdk

即可正常执行

 

 


标题:ubuntu下执行javac失败
作者:hugh0524
地址:https://blog.uproject.cn/articles/2017/08/14/1502723189869.html