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 :: git pull not taking latest changes 
Shell :: bash echo in variable 
Shell :: get only file names from CMD 
Shell :: install bully kali 
Shell :: download terraform for mac 
Shell :: how to open file in linux 
Shell :: composer install on mac 
Shell :: ubuntu dot to png 
Shell :: how to put a youtube video in github description 
Shell :: writing to a text file in batch script 
Shell :: xbox 360 wireless adapter linux 
Shell :: crontab example 
Shell :: wp cli tagline 
Shell :: ps see full command 
Shell :: umask 
Shell :: how to compare percentage value in shell script 
Shell :: test gatsby app on mobile 
Shell :: android studio git 
Shell :: cronjob in termux 
Shell :: fatal pathspec is in submodule 
Shell :: macos git set vscode as editor 
Shell :: chocolatey 
Shell :: pdf-tools debian 
Shell :: install rtools rstudio 
Shell :: ubuntu libqt4 
Shell :: Compress files powershell 
Shell :: install newman-reporter-htmlextra 
Shell :: yarn change version 
Shell :: xargs parameter 
Shell :: error: insufficient permissions for device 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =