1

Ubuntu noob here. When using Windows I just copy paste this in cmd:

set Path=C:\Program Files\Java\jdk1.8.0_60\bin
set HomePath= C:\Program Files\Java\ jdk1.8.0_60

What would the syntax for this be in Ubuntu? assuming /usr/bin/java. A concise answer would be appreciated.

snoop
  • 4,110
  • 9
  • 41
  • 58

2 Answers2

1

Like the other answer said, the linux equivalent is this:

JAVA_HOME=/path/to/your/jdk
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

But how will you find out the /path/to/your/jdk? (Assuming you are a noob here). For that, you will have to run this command:

which java

which is a standard linux command that gives you the full path to any file (or blank if the file isn't locatable). This will return you a path like /usr/lib/jvm/jdk1.8.0_05/bin, and after removing the /bin at the end, you can take the rest of path and assign it to JAVA_HOME.

Hope that helps.

Prahlad Yeri
  • 1,657
0

Here it is:

JAVA_HOME=/usr/lib/jvm/jdk1.8.0
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
Tung Tran
  • 4,023