LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-14-2003, 05:32 PM   #1
KptnKrill
Member
 
Registered: Apr 2003
Location: US, MA
Distribution: Nandu-0.ab, Arch 0.7.2
Posts: 229

Rep: Reputation: 30
Java SDK 1.4 Install


I installed the Java 2 SDK and the install went fine however the compiler and such are in a directory (usr/java/j2sdk1.4.2) and I'm getting sick of typing ...
$ /usr/java/j2sdk1.4.2/bin/javac Program.java
every single time.
Basically, I wondering if there is a way for me to just be able to type "javac Program.java" as if it were a command. tia
 
Old 08-14-2003, 05:52 PM   #2
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
You can make a soft link (see ln command) in /usr/bin pointing to your javac and java executables.

Or

You can add the path to the java1.4.2 bin directory in the .bash_profile file.
You will need to append it to the PATH variable.
.bash_profile is located in your user's HOME directory.

Or

If you want to make it global to all users, you will need to edit /etc/profile
You will also need to append the path to the PATH variable.
 
Old 08-14-2003, 06:25 PM   #3
KptnKrill
Member
 
Registered: Apr 2003
Location: US, MA
Distribution: Nandu-0.ab, Arch 0.7.2
Posts: 229

Original Poster
Rep: Reputation: 30
How would I append my path variable?
 
Old 08-14-2003, 06:50 PM   #4
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Each user (including root) has a file called .bash_profile in there HOME directory.
Edit this file and change the line PATH=$PATH:$HOME/bin to
Code:
PATH=$PATH:$HOME/bin:/usr/java/j2sdk1.4.2/bin
 
Old 08-14-2003, 07:17 PM   #5
KptnKrill
Member
 
Registered: Apr 2003
Location: US, MA
Distribution: Nandu-0.ab, Arch 0.7.2
Posts: 229

Original Poster
Rep: Reputation: 30
Hmm. It's still not working. I get the horrific "command not found" message. Here's my .bash_profile file. Does anything seem amiss?

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/java/j2sdk1.4.2/bin
export PATH
unset USERNAME
 
Old 08-14-2003, 07:29 PM   #6
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
You need to fully logout for the changes to take effect.
I forgot to mention that part...
 
Old 08-14-2003, 08:47 PM   #7
KptnKrill
Member
 
Registered: Apr 2003
Location: US, MA
Distribution: Nandu-0.ab, Arch 0.7.2
Posts: 229

Original Poster
Rep: Reputation: 30
ah thanks!
 
  


Reply


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
Java SDK & JRE Install Avi Linux - Software 1 10-02-2005 08:32 PM
java SDK install jet_zeng Linux - Software 5 05-10-2005 11:57 AM
how to install java 2 sdk? pdmackenzie Linux - Software 9 04-07-2004 08:39 AM
Java SDK 1.4.2 install. lifted_one Programming 4 11-06-2003 12:55 AM
Java 1.4.0 SDK install problem insom Linux - Newbie 3 09-05-2003 04:01 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration