Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 03-24-2003, 11:50 PM   #1
LQ Newbie
Registered: Mar 2003
Posts: 9

Rep: Reputation: 0
Post setting path for java

hi, im new to linux and i need java. i downloaded the new java sdk and installed it with no problems but I need to set paths in order to be able to compile and run my files. I have no clue how to do this. Any help would be greatly appreciated.
Old 03-25-2003, 12:20 AM   #2
Registered: Mar 2002
Location: INDIA
Distribution: Mandrake Linux 9.2, Knoppix 3.0
Posts: 158

Rep: Reputation: 30
there is a file called $HOME/.bash_profile
u can add the path of java there
Old 03-25-2003, 12:32 AM   #3
LQ Guru
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45

* Create a download directory:

mkdir $HOME/archive


* Download J2SE 1.4.1 sdk RPM to your archive directory. Get the SDK here.
* The file is called: j2sdk-1_4_1_01-linux-i586-rpm.bin
* This script is not executable, therefore type:

chmod a+x j2sdk-1_4_1_01-linux-i586-rpm.bin



* Than agree to the licensing terms.


* Note that your archive directory now contains a new file called: j2sdk-1_4_1_01-fcs-linux-i586.rpm
* Install the SDK. Type: su (and enter super user password).

rpm -ivh j2sdk-1_4_1_01-fcs-linux-i586.rpm

* The SDK is now installed however there are still a few configuration tasks.
* This is where most people have trouble.


* Linking the plugin to Mozilla and Galeon (Galeon uses Mozilla plugins).
* We should still be in super user mode. If not than become super user again: su (password).

ln -s /usr/java/j2sdk1.4.1_01/jre/plugin/i386/ns610/ /usr/lib/mozilla-1.1/plugins/

* Now your browers (Mozilla and Galeon) will display Java2 1.4.1 websites.
* Exit as super user. Type: exit


* Configuring the executable PATH.
* In regular user mode.

emacs $HOME/.bash_profile

* At the very bottom of the file add the line:

export PATH=/usr/java/j2sdk1.4.1_01/bin:$PATH

* Exit emacs by holding down Ctrl and pressing x than s than x than c.

Ctrl - x - s - x - c

* Now log out and log back in, so that the settings to take effect.


* Test the configuration of the executable PATH. Simply type:


* You should see a list of the java compiler command switches.
* Find a tutorial or book and write some Java2 programs.
* If you have problems you can mail

* Note: If you have a backup file (ls -al $HOME) called .bash_profile~ in addition
* to your new .bash_profile (without the ~), than delete the backup (rm ./.bash_profile~)
* Than try loging back in and everything should work. For some reason the backup file
* overrides the new script.

real adress for the tutorial
Old 03-25-2003, 09:08 AM   #4
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
You can also modify the PATH in /etc/profile so that all users can see java, not just those that have modified .bash_profile
Old 03-25-2003, 05:30 PM   #5
LQ Newbie
Registered: Mar 2003
Posts: 9

Original Poster
Rep: Reputation: 0
thanks to everyone


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Setting Java Path gtkmike SUSE / openSUSE 1 05-09-2005 05:05 PM
Setting the path variable for Java Comp. lmellen Programming 1 06-27-2004 11:38 PM
Setting the PATH for Java bruce64 Linux - Software 9 09-22-2003 12:19 PM
Setting Java path for root adcripps Linux - General 3 03-16-2002 03:36 PM
Setting Java path issues... jmizza Linux - Newbie 8 02-27-2002 09:23 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:52 AM.

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