0
我爲我的項目使用Maven,並且需要在我的系統中設置環境變量才能使其工作。我爲maven設置了環境變量,但它也需要設置Java環境變量。我通過Putty通過遠程服務器訪問Linux。在Linux中爲MAVEN設置環境變量
我試圖建立JAVA_HOME
環境變量,但是當我執行mvn -version
我得到這個錯誤:
/home/z222189/apache-maven-3.2.1/bin/mvn: line 190:
/home/z222189/jdk1.8.0_31/bin/java: cannot execute binary file
/home/z222189/apache-maven-3.2.1/bin/mvn: line 190:
/home/z222189/jdk1.8.0_31/bin/java: Success
`+ '[' -z '' ']'
+ '[' -f /etc/mavenrc ']'
+ '[' -f /home/z222189/.mavenrc ']'
+ cygwin=false
+ darwin=false
+ mingw=false
+ case "`uname`" in
++ uname
+ '[' -z /home/z222189/jdk1.8.0_31 ']'
+ '[' -z /home/z222189/apache-maven-3.2.1 ']'
+ false
+ false
+ '[' -z /home/z222189/jdk1.8.0_31 ']'
+ '[' -z '' ']'
+ '[' -n /home/z222189/jdk1.8.0_31 ']'
+ '[' -x /home/z222189/jdk1.8.0_31/jre/sh/java ']'
+ JAVACMD=/home/z222189/jdk1.8.0_31/bin/java
+ '[' '!' -x /home/z222189/jdk1.8.0_31/bin/java ']'
+ '[' -z /home/z222189/jdk1.8.0_31 ']'
+ CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+ false
+ MAVEN_CMD_LINE_ARGS=-version
+ export MAVEN_CMD_LINE_ARGS
+ exec /home/z222189/jdk1.8.0_31/bin/java -classpath /home/z222189/apache-maven-3.2.1/boot/plexus-classworlds-2.5.1.jar -Dclassworlds.conf=/home/z222189/apache-maven-3.2.1/bin/m2.conf -Dmaven.home=/home/z222189/apache-maven-3.2.1 org.codehaus.plexus.classworlds.launcher.Launcher -version
/home/z222189/apache-maven-3.2.1/bin/mvn: line 190: /home/z222189/jdk1.8.0_31/bin/java: cannot execute binary file
/home/z222189/apache-maven-3.2.1/bin/mvn: line 190: /home/z222189/jdk1.8.0_31/bin/java: Success`
這是錯誤我在bash獲得-x MVN -version
線190 MVN文件是:'EXEC「$ JAVACMD」 \' –
嘗試與調試開關'的bash運行它-x MVN -version' –
@Yuri得到同樣的錯誤 –