Answers for "set java_home variable in ubuntu"

1

set $JAVA_HOME variable in ubuntu

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Posted by: Guest on January-27-2021
0

set java home in ubuntu

Java is typically installed in /usr/java locate the version you have and then do the following:

Assuming you are using bash (if you are just starting off, i recommend bash over other shells) you can simply type in bash to start it.

Edit your ~/.bashrc file and add the paths as follows:

for eg. vi ~/.bashrc

insert following lines:

export JAVA_HOME=/usr/java/<your version of java>
export PATH=${PATH}:${JAVA_HOME}/bin

after you save the changes, exit and restart your bash or just type in bash to start a new shell

Type in export to ensure paths are right.

Type in java -version to ensure Java is accessible.
Posted by: Guest on March-09-2022

Code answers related to "set java_home variable in ubuntu"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language