安装oracle-java8-set后未设置webupd8 JAVA_HOME

时间:2021-02-01 23:26:59

I'm following this link to install Oracle Java 8.

下面是安装Oracle Java 8的链接。

Maybe I got this wrong, but I suppose JAVA_HOME should be set after installing oracle-java8-set-default.

也许我搞错了,但是我认为应该在安装oracle-java8-set-default之后设置JAVA_HOME。

If I echo $JAVA_HOME or printenv | grep -i java nothing comes up. I'm using Linux Mint 17.1 (Rebecca)

如果我回显$JAVA_HOME或printenv | grep -i java什么都不会出现。我正在使用Linux Mint 17.1 (Rebecca)

Thanks!

谢谢!

2 个解决方案

#1


15  

Your JAVA_HOME will not be set by the webupd8 method, and you don't normally need it (because the update-java-alternatives script manages the environment). If you're looking for the folder it's under "/usr/lib/jvm" and you can certainly do

您的JAVA_HOME将不会由webupd8方法设置,您通常不需要它(因为更新-java-替代脚本管理环境)。如果您正在查找它位于“/usr/lib/jvm”下的文件夹,那么您当然可以这样做

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

and you can also test which Java is active with

您还可以测试哪个Java是活动的

java -version

or

java -fullversion

#2


12  

You need to run also the command:

您还需要运行以下命令:

sudo apt-get install oracle-java8-set-default

as described in WebUpd8 site, then you need to logout and login back again, since the specific command creates two files under /etc/profile.d, named jdk.sh and jdk.csh which populate the environment with JAVA_HOME etc.

正如WebUpd8站点中所描述的,然后您需要注销并再次登录,因为特定的命令在/etc/ profile8下创建两个文件。d,名叫jdk。sh和jdk。用JAVA_HOME等填充环境的csh。

#1


15  

Your JAVA_HOME will not be set by the webupd8 method, and you don't normally need it (because the update-java-alternatives script manages the environment). If you're looking for the folder it's under "/usr/lib/jvm" and you can certainly do

您的JAVA_HOME将不会由webupd8方法设置,您通常不需要它(因为更新-java-替代脚本管理环境)。如果您正在查找它位于“/usr/lib/jvm”下的文件夹,那么您当然可以这样做

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

and you can also test which Java is active with

您还可以测试哪个Java是活动的

java -version

or

java -fullversion

#2


12  

You need to run also the command:

您还需要运行以下命令:

sudo apt-get install oracle-java8-set-default

as described in WebUpd8 site, then you need to logout and login back again, since the specific command creates two files under /etc/profile.d, named jdk.sh and jdk.csh which populate the environment with JAVA_HOME etc.

正如WebUpd8站点中所描述的,然后您需要注销并再次登录,因为特定的命令在/etc/ profile8下创建两个文件。d,名叫jdk。sh和jdk。用JAVA_HOME等填充环境的csh。