Friday, 15 March 2013

Setting java path in linux

After installing JDK or JRE on Linux/Unix platform, you have to set PATH environment variable so that you can run the executables (javac.exe, java.exe, javadoc.exe, and so on) from any directory without having to type the full path of the command.
 Steps to set up java path in linux

1. Create a file in /etc/profile.d directory with content as follows: 
The file contains various shell commands which set and export necessary environment variables for Java. Shell settings from configuration files in the /etc/profile.d directory are gathered by/etc/profile during login, setting up user environment information for every user.  
2.  Assign execute permissions:
# chmod 755

3. You can verify the path  by typing the below command in the terminal

# java -version 

1 comment:

  1. JavaOne 2013 is apparently being held at Hyderabad this year as well (8-9 May) at the same place guys…. They have also started accepting registrations (check this: )