LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-15-2005, 01:38 PM   #1
Beeker
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Rep: Reputation: 0
Adjusting my profile for java/jGRASP use


I have been having some problems lately trying to get jGRASP to work on my newly installed linux box, though I am in contact with the project leader I figure more suggestions couldn't hurt.

Here is what I get when I try to run jGRASP:

[root@localhost root]# /root/jgrasp/bin/java
[root@localhost root]#

jGRASP exec error: command "java" not found.
Unable to run jgrasp.

I was informed that I need to adjust my bash profile (which seems to be /etc/profile for my system release), but so far I have not gotten it to work. Please keep in mind you are dealing with a complete newb to the linux system, so telling me to do things without a walkthrough will probably get me in trouble, that being said, here is my information-

jGRASP directory- /usr/java/jgrasp
Java directory- /usr/java/jdk1.5.0_02
Suggested addition to /etc/profile- PATH=$PATH:/path_to_java/bin/java

/etc/profile (items I have added in red)-

# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

pathmunge () {
if ! echo $PATH | /bin/egrip -q "(^|$1($|" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}

# Path manipulation
if [ 'id -u' = 0 ] ; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi

pathmunge /usr/X11R6/bin after

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

USER="'id -un'"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"

HOSTNAME='/bin/hostname'
HISTSIZE=1000
PATH=$PATH:/usr/java/jdk1.5.0_02/bin/java

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done

unset i
unset pathmunge




Thank you in advance for any help you can provide regarding my problem!
 
Old 03-15-2005, 01:44 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 126Reputation: 126
First off, path should be a list of directories, not files. So you'd want /path/to/java/bin, without the final "java". Secondly, I wouldn't mess with /etc/profile, I'd modify .profile or .bash_profile for this.
 
Old 03-15-2005, 01:58 PM   #3
Beeker
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Hah, see this is exactly where the learning curve is biting me in the butt...

There is a diference between bash and .bash?

I have never been able to find a .bash file, nor a bash_profile file (with or without the '.').

I went to the /etc/bashrc file and the very first lines were:

# /etc/bashrc

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

Since I was told that I needed the environmental stuff, I went to /etc/profile.


I have tried removing the last /java from the path, but also with no effect.
 
Old 03-15-2005, 02:26 PM   #4
Beeker
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Quick edit.

After double-checking to make sure what I typed above was correct, I found .bash_profile

It exists in three locations-

/root/
/etc/skel/
/home/daniel/

I assume I only need to adjust the one under /etc/skel/ ?

Going to give it a try now...
 
Old 03-15-2005, 02:50 PM   #5
Beeker
LQ Newbie
 
Registered: Mar 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Holy crap, it worked!

OK, for future refrence in case somebody else runs into this problem, adjustments had to be made in the .bash_profile AND under /ect/profile, here is what mine look like:

# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

pathmunge () {
if ! echo $PATH | /bin/egrip -q "(^|$1($|" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}

# Path manipulation
if [ 'id -u' = 0 ] ; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi

pathmunge /usr/X11R6/bin after

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

USER="'id -un'"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"

HOSTNAME='/bin/hostname'
HISTSIZE=1000
PATH=$PATH:/usr/java/jdk1.5.0_02/bin:$PATH

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi

export JAVAHOME=/usr/java/jdk1.5.0_02
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done

unset i
unset pathmunge


For the .bash_profile, I added the following line wherever I could find the file (find -name .bash_profile). Don't know if that is needed or not, but I'm not arguing with the results.


# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
PATH=$PATH:/usr/java/jdk1.5.0_02/bin/java

export PATH
unset USERNAME



Hopefully this will help some other poor linux newb who needs to get his jGRASP to work.

Thank you for the suggestions, if nothing else they definately got my mind on the right track!
 
  


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
Jgrasp installation on RedHat9 joshuak Programming 3 01-14-2006 05:56 PM
jGRASP IDE in Mandrake 10.1 goofy871 Programming 0 02-26-2005 06:26 PM
locating and edition .profile for java paths Madaize Linux - Newbie 1 11-07-2004 12:41 AM
jGrasp IDE jwjody Programming 3 04-11-2004 02:17 AM
adjusting time under RH trutnev Red Hat 1 03-28-2004 02:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:43 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration