我检查时收到了这个警告 mvn -version
Warning: JAVA_HOME environment variable is not set. Apache Maven 3.0.5 Maven home: /usr/share/maven Java version: 1.6.0_37, vendor: Sun Microsystems Inc. Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.19.0-25-generic", arch: "amd64", family: "unix"
我查了一下java
which java /usr/bin/java
我检查过maven
which mvn /usr/bin/mvn
我应该在bashrc中为java和maven写什么?
如果您尝试运行以下命令,则似乎没有安装Java JDK(Java开发工具包):
javac -version
可能您会得到以下信息:
The program 'javac' can be found in the following packages: * default-jdk * ecj * gcj-4.6-jdk * gcj-4.7-jdk * openjdk-7-jdk * openjdk-6-jdk Try: sudo apt-get install
因此,您必须运行以下命令将安装Java JDK的OpenJDK版本:
sudo apt-get install default-jdk