Score:0

Set JAVA_HOME in Ubuntu without "install" the JDK

ec flag

I've just downloaded and extracted the JDK archive, next moving it to my /opt directory. Inside IntelliJ, everything is working properly. I just point the path to the JDK in the settings. But I cannot issue java -version command... It says that I need to "install" Java... The question is: how can I set JAVA_HOME environment variable in Ubuntu, without actually "install" the JDK? Thanks!

Score:1
in flag

Add

export JAVA_HOME=/opt/path/to/jdk
export PATH=${PATH}:/opt/path/to/jdk/bin

to your ~/.bashrc.
After that, either reboot or apply these changes to your current shell with

source ~/.bashrc
pcbillions53 avatar
ec flag
Right after I follow your suggested steps, it do not work... Then, searching in Google, I found that a also need to run source command. But now everything is OK. I think you could update your answer, to include this last step. Thank you!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.