LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2007, 08:42 AM   #1
Cyhaxor
Member
 
Registered: Nov 2004
Location: UK
Distribution: Fedora 12
Posts: 129

Rep: Reputation: 15
JAVA environment PATH


Ok I have installed the java JDK under /home/cyhaxor/java/jdk1.6.0_03

How I set the environment path so every time I type javac or java in terminal recognize the command?

I tried:
Code:
export PATH=/home/cyhaxor/java/jdk1.6.0_03/bin:$PATH
export JAVA_HOME="/home/cyhaxor/java/jdk1.6.0_03"
export CLASSPATH=:/home/cyhaxor/java/jdk1.6.0_03
In terminal but is not working


Thanks in advance,
Cyhaxor
 
Old 11-03-2007, 11:12 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Try doing it this way: export PATH=$PATH:(path/to/directory/here).

Last edited by {BBI}Nexus{BBI}; 11-03-2007 at 11:14 AM.
 
Old 11-03-2007, 12:58 PM   #3
Cyhaxor
Member
 
Registered: Nov 2004
Location: UK
Distribution: Fedora 12
Posts: 129

Original Poster
Rep: Reputation: 15
What the hell is that? anw that's not answering my question!
 
Old 11-03-2007, 02:13 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by Cyhaxor View Post
Ok I have installed the java JDK under /home/cyhaxor/java/jdk1.6.0_03

How I set the environment path so every time I type javac or java in terminal recognize the command?

I tried:
Code:
export PATH=/home/cyhaxor/java/jdk1.6.0_03/bin:$PATH
export JAVA_HOME="/home/cyhaxor/java/jdk1.6.0_03"
export CLASSPATH=:/home/cyhaxor/java/jdk1.6.0_03
In terminal but is not working


Thanks in advance,
Cyhaxor
Please define 'not working'. This can be many things, and my guess right now is that it has nothing to do with the environment variables you list.
--- rod.
 
Old 11-04-2007, 01:39 AM   #5
Cyhaxor
Member
 
Registered: Nov 2004
Location: UK
Distribution: Fedora 12
Posts: 129

Original Poster
Rep: Reputation: 15
Is not working - It still not recognize the command javac as an environment command.. I have to go in /home/cyhaxor/java/jdk1.6.0_03/bin to get the compiler working...
 
Old 11-04-2007, 03:16 AM   #6
devn
Member
 
Registered: Mar 2007
Location: Bangladesh
Distribution: Suse, Solaris
Posts: 40

Rep: Reputation: 15
Smile

Quote:
Originally Posted by Cyhaxor View Post
Is not working - It still not recognize the command javac as an environment command.. I have to go in /home/cyhaxor/java/jdk1.6.0_03/bin to get the compiler working...
If your path to java is /home/cyhaxor/java/jdk1.6.0_03/bin, try this out:
Code:
export PATH=$PATH:/home/cyhaxor/java/jdk1.6.0_03/bin
And from the same terminal session, type javac or simply jav[TAB] (if tab completion is enabled!!!). You should get your solution.
 
Old 11-04-2007, 05:00 AM   #7
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Here are my own entries. I haven't bothered adjusting the paths to your needs so you'll have to do that yourself.

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export J2RE_HOME=/usr/lib/jvm/java-6-sun/jre
export JAVA_BIN=$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME:$JAVA_HOME/lib
export PATH=$JAVA_BIN:$PATH
 
Old 11-04-2007, 11:58 AM   #8
Cyhaxor
Member
 
Registered: Nov 2004
Location: UK
Distribution: Fedora 12
Posts: 129

Original Poster
Rep: Reputation: 15
Ok guys I have done it!! Thanks a lot for the support!
 
  


Reply

Tags
classpath, java



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 03:04 AM
export Path=/usr/java:$Path does not seem to work lumix Linux - Newbie 1 03-19-2007 03:11 PM
PATH environment variable moonz Red Hat 3 09-08-2005 04:10 PM
Adding Java to my environment path? C8H10N4O2 Linux - Software 6 04-19-2004 01:38 PM
How to set path environment? Junior Linux - Newbie 3 02-23-2004 07:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration