Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best way to set Java_Home in linux

 
riyas nedumpurath
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I installed jdk in ubuntu linux 9.04 last week. Following a post in a forum, I changed bash_profile file to add JAVA_HOME and PATH as last line. When I restarted the system, i had the horror of system not booting. I had to reinstall the OS. Can anybody explain a safe way to do this???
Thanks
 
Campbell Ritchie
Sheriff
Pie
Posts: 49447
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way I did it was to edit ~/.bashrc, adding the following line:
export PATH=/usr/java/jdk1.6.0_14/bin/:.:$PATH
Note I addded a . as well, so I can call en executable in the same directory without writing "./xxx". You can write the same line as a command whenever you open a shell; then you can alter the JDK version used for different shells.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic