简体   繁体   English

WSO2 身份服务器 - Carbon 无法执行 Java

[英]WSO2 Identity Server - Carbon cannot execute Java

I'm using Ubuntu 16.04 64-bit.我正在使用 Ubuntu 16.04 64 位。 I installed Oracle JDK jdk1.8.0_144 in /usr/local/java and set the symlinks as below.我在/usr/local/java安装了 Oracle JDK jdk1.8.0_144并设置了如下符号链接。

$ 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

After that, I followed the installation guide in the WSO2 documentation and set JAVA_HOME as below.之后,我按照 WSO2 文档中的安装指南将JAVA_HOME为如下。

nano /.bashrc

added the variable:添加了变量:

export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export PATH=${JAVA_HOME}/bin:${PATH}

I close the old terminals and open a new one and run:我关闭旧终端并打开一个新终端并运行:

echo $JAVA_HOME

and I get我得到

/usr/local/java/jdk1.8.0_144

However, when I run sh wso2server.sh I get the error:但是,当我运行sh wso2server.sh出现错误:

JAVA_HOME is not defined correctly.
CARBON cannot execute java

error.错误。

You should try to add the following into your .bash_profile您应该尝试将以下内容添加到您的.bash_profile

export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/jre/bin:$PATH

There is similar issue: Ubuntu: JAVA_HOME is not defined correctly有类似的问题: Ubuntu: JAVA_HOME 没有正确定义

There are many other causes of this issue:此问题还有许多其他原因:

1) You are running the server as the super user (sudo) which is not required. 1)您以不需要的超级用户(sudo)身份运行服务器。 However I think you dont have the JAVA_HOME set in super user environment.但是我认为您没有在超级用户环境中设置JAVA_HOME

2) You can try: sudo JAVA_HOME=/usr/lib/jvm/java-7-oracle ./wso2server.sh 2)您可以尝试: sudo JAVA_HOME=/usr/lib/jvm/java-7-oracle ./wso2server.sh

3) You should probably be setting JAVA_HOME to /usr/lib/jvm/jdk1.7.0/jre rather than /usr/lib/jvm/jdk1.7.0 . 3)您可能应该将JAVA_HOME/usr/lib/jvm/jdk1.7.0/jre而不是/usr/lib/jvm/jdk1.7.0

4) Your version of Identity Server does not support java 8. 4) 您的身份服务器版本不支持 java 8。

replace your java home path in wso2server.sh line no 52替换 wso2server.sh 第 52 行中的 java 主路径

#JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home

JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WSO2 服务器未启动:org.wso2.carbon.server.util.BundleInfoLine.getInstance(BundleInfoLine.java:87) - WSO2 server not starting: org.wso2.carbon.server.util.BundleInfoLine.getInstance(BundleInfoLine.java:87) wso2 应用服务器(carbon)启动错误 - wso2 app server (carbon) startup error WSO2 Identity Server是否支持Java 5(JDK 1.5)? - Will WSO2 Identity Server support Java 5( JDK 1.5)? WSO2身份服务器的MEX端点 - MEX endpoint for WSO2 Identity Server WSO2 Identity Server 自定义租户监听器 - WSO2 Identity Server custom Tenant Listener wso2身份服务器oauth userinfo没有角色 - wso2 identity server oauth userinfo no role wso2 身份服务器 java.lang.OutOfMemoryError: Java heap space - wso2 identity server java.lang.OutOfMemoryError: Java heap space java.net.SocketTimeoutException:WSO2 Identity Server OAuth令牌验证上的读取超时 - java.net.SocketTimeoutException: Read timed out on WSO2 Identity Server OAuth Token Validation 在WSO2身份服务器5.5.0中配置MFA时如何解决java.security.InvalidKeyException - How to resolve java.security.InvalidKeyException while configuring MFA in WSO2 identity server 5.5.0 无法使用AuthenticationAdmin API身份验证为WSO2 Identity Server 5.1.0创建Java客户端 - Unable to create a java client to WSO2 Identity Server 5.1.0 using AuthenticationAdmin API Authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM