我正在使用Ubuntu 16.04 64位。我在/usr/local/java
中安裝了Oracle JDK jdk1.8.0_144
,並設置符號鏈接如下。WSO2身份認證服務器 - Carbon無法執行Java
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_144/jre/bin/java" 1
$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_144/bin/javac" 1
$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_144/jre/bin/javaws" 1
$ sudo update-alternatives --set java /usr/local/java/jdk1.8.0_144/jre/bin/java
$ sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_144/bin/javac
$ sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_144/jre/bin/javaws
在那之後,我跟着WSO2文檔中的安裝引導件和設置如下JAVA_HOME
。
nano /.bashrc
添加變量:
export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export PATH=${JAVA_HOME}/bin:${PATH}
我關閉舊終端和打開一個新的,然後運行:
echo $JAVA_HOME
,我得到
/usr/local/java/jdk1.8.0_144
然而,當我運行sh wso2server.sh
時,我得到了錯誤r:
JAVA_HOME is not defined correctly.
CARBON cannot execute java
錯誤。
嘗試封閉與報價如下JAVA_HOME路徑, '出口JAVA_HOME = 「在/ usr /本地/ JAVA/jdk1.8.0_144」' – pulasthi7