Set Java Path Linux Example

Set Java Path Linux Example

In this example we will set Java path in command line which will be avaible only for current command including we will also set path which will be permanent for all users:

Set Java path for current command:

  • First find where is Java installed and located:

  • As you see above we used “locate” command to find out where is JDK installed and what are the version. So we found two version of JDK is installed. Let’s say if you want to set “jdk1.8.0_51” path then do below:

That’s it for set path in current command. 

  • Now to set path permanently for all users please do below:

  • Reference:


Leave a Reply

Your email address will not be published. Required fields are marked *