“Defina a casa Java no Ubuntu” Respostas de código

Como instalar o Java 8 e definir java_home no Ubuntu

sudo apt install openjdk-8-jdk
Splendid-est Swan

defina java_home permanentemente ubuntu

sudo gedit /etc/profile
#add following lines

JAVA_HOME=/usr/lib/jvm/{your jdk path}
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
#logout to update the changes
Glorious Goat

Defina a casa Java no 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.
namesaq

Respostas semelhantes a “Defina a casa Java no Ubuntu”

Perguntas semelhantes a “Defina a casa Java no Ubuntu”

Mais respostas relacionadas para “Defina a casa Java no Ubuntu” em Shell/Bash

Procure respostas de código populares por idioma

Procurar outros idiomas de código