Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

set java_home permanently 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
Comment

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.
Comment

PREVIOUS NEXT
Code Example
Shell :: search git -G 
Shell :: check size of hidden current directory linux 
Shell :: get file size in bash 
Shell :: bash convert string to uppercase 
Shell :: grep but exclude directory 
Shell :: install docker fedora 
Shell :: heroku postgres reset database 
Shell :: how to update discord on ubuntu 
Shell :: IF NOT DIR BASH 
Shell :: docker compose stop 
Shell :: git log grep 
Shell :: push code to github repository from command line 
Shell :: git download specific commit 
Shell :: show branch detail branch info in git 
Shell :: pass awk varible to bash 
Shell :: windows vpn service 
Shell :: linux bash command to clean up log files in /var/log 
Shell :: update aws amplify cli 
Shell :: add gif to readme.so 
Shell :: powershell check file extension 
Shell :: Remove all your local git branches but keep master 
Shell :: sudo snap linux store 
Shell :: install next.js 
Shell :: whoami command 
Shell :: block comment bash 
Shell :: how to count files in a directory linux 
Shell :: npm global installation not showing 
Shell :: import ovpn file ubuntu 
Shell :: how to edit crontab in linux 
Shell :: chocolatey installation 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =