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 03-29-2004, 02:37 PM   #1
Ygarl
Member
 
Registered: Mar 2004
Location: London, UK
Distribution: Ubuntu Breezy and Dyne:Bolic
Posts: 64

Rep: Reputation: 15
How do you set up links or paths in LINUX? Mandrake 9.2 Java VM



Hi!
I must be posting more than anyone else here! LOL

I am setting up JAVA VM on my system, and I keep seeing references to 'virtual links' and 'making links' to programs, etc.

If I run 'java' in the shell, it won't let me. If I run: ./java it is quite happy...
That's fine - but if I try to run Java apps, it can't seem to find the directory.

Do I need to do something like 'Paths' in WinDoze? etc?

How would I do such a thing, assuming this is how I 'tell' Linux where all the Java stuff is?

Thanks!
 
Old 03-29-2004, 02:42 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,537

Rep: Reputation: 149Reputation: 149
You need to change PATH. From console it's:
export PATH=$PATH:/somewhere/java/bin
To make the change permanent, add the line to .bashrc in your home directory.
 
Old 03-29-2004, 02:44 PM   #3
Ygarl
Member
 
Registered: Mar 2004
Location: London, UK
Distribution: Ubuntu Breezy and Dyne:Bolic
Posts: 64

Original Poster
Rep: Reputation: 15
Woohoo!
That's exactly what I was after!

Thanks!
 
Old 03-29-2004, 02:52 PM   #4
Ygarl
Member
 
Registered: Mar 2004
Location: London, UK
Distribution: Ubuntu Breezy and Dyne:Bolic
Posts: 64

Original Poster
Rep: Reputation: 15
Umm... before you toddle off... Here's my bashrc file:
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
umask 002
else
umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
case $TERM in
xterm*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
*)
;;
esac
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

if [ -z "$loginsh" ]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -x $i ]; then
. $i
fi
done
fi
fi
PATH=$PATH:/usr/java/j2re1.4.2_04/bin
unset loginsh

That's it - sound about right? It's in /etc/
Thanks (sorry - I really AM a newb!)
 
Old 03-29-2004, 03:00 PM   #5
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,537

Rep: Reputation: 149Reputation: 149
export PATH=$PATH:/usr/java/j2re1.4.2_04/bin
It can be in /etc/bashrc. It'll make the change for all users. Changing in /home/you/.bashrc would affect only your account.
 
  


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
Symbolic Links, directories, and relative paths (../). Can it be done? jimwillsher Linux - Newbie 1 03-11-2005 05:27 PM
relative/absolute paths in Java djgerbavore Programming 2 10-26-2004 08:01 PM
how do you alter/ add to paths set on startup? PaleViper Linux - Newbie 4 10-08-2004 01:55 PM
how do i set up a webserver using mandrake 10 to use java servlets almvtb Mandriva 0 06-29-2004 03:21 PM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 10:15 PM


All times are GMT -5. The time now is 07:37 PM.

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