Re: [flalug] Java

From: Ken Dickson (casey24601@yahoo.com)
Date: Thu Oct 02 2003 - 07:30:14 EDT


Come on, Smitty! Don't quit on me now! :-D
Tell me, am I at least working with the right file (/etc/bashrc)?

Smitty wrote:

>You did something other than I previously stated. Please review the previous
>replies.
>Smitty
>
>On Wednesday 01 October 2003 22:41, you wrote:
>
>
>>There is a file named bashrc in /etc. It is laid out like this:
>>
>># /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
>>
>>
>>unset loginsh
>>
>>
>>I open the file with OpenOffice and edit it, adding the lines at the
>>bottom (see below).
>>
>># /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
>>
>>export JAVA_HOME=/usr/java/j2sdk1.4.2_01
>>
>>export PATH=$PATH:$JAVA_HOME/bin
>>
>>unset loginsh
>>
>>
>>I save the file, making sure to save it as a plain text document. Then,
>>I try to run the .jar file in the terminal. I get the same error ("bash:
>>java: command not found"). Am I close on this or in the wrong place?
>>
>>Smitty wrote:
>>
>>
>>>I believe the file is called .bashrc and it is in every user's home
>>>directory, as well as, /root. You don't have to log in as root to
>>>configure the users. Smitty
>>>
>>>On Wednesday 01 October 2003 21:45, you wrote:
>>>
>>>
>>>>Thanks for the responce, Smitty. I login under root. So, are you saying
>>>>I should have a file in /root called ".bash_profile"? I did a search,
>>>>and I don't have that file anywhere on my harddrive. Could it be the
>>>>result of java not being properly installed?
>>>>
>>>>Smitty wrote:
>>>>
>>>>
>>>>>On Wednesday 01 October 2003 20:16, you wrote:
>>>>>
>>>>>
>>>>>>Trying to get it so I can run .jar files. I have Java properly
>>>>>>installed because I can run applets from the web. I asked someone from
>>>>>>a different forum what I should do, and they said I need to edit my
>>>>>>bash file (see below). Can someone translate this to a little simpler
>>>>>>language for a newbie? :-)
>>>>>>-Ken
>>>>>>
>>>>>>
>>>>>>
>>>>>>>RE: Java / Neuros DBM
>>>>>>> 2003-09-30 20:52
>>>>>>> Java is not in your path. You want to put these entries in your
>>>>>>>.bash_profile file.
>>>>>>>
>>>>>>>
>>>>>That is a file in your home user directory. It is a dotted file.
>>>>>
>>>>>
>>>>>
>>>>>>> export JAVA_HOME= * put java location here *
>>>>>>>
>>>>>>>
>>>>>That is where java is installed on your hard drive. In a terminal input
>>>>>the command: which java
>>>>>The output will give you the path to the java binary on your hd.
>>>>>On mine it is /usr/lib/java/jre/bin/java
>>>>>
>>>>>
>>>>>
>>>>>>> export PATH=$PATH:$JAVA_HOME/bin
>>>>>>>
>>>>>>> Note, you'll have to find where java is installed on your box.
>>>>>>>On my box it's installed in /usr/java/j2sdk1.4.1_01 so my JAVA_HOME
>>>>>>>is:
>>>>>>>
>>>>>>> export JAVA_HOME=/usr/java/j2sdk1.4.1_01
>>>>>>>
>>>>>>> Make those changes and open up a new terminal.
>>>>>>>
>>>>>>>
>>>>>Hope that helps.
>>>>>Smitty
>>>>>
>>>>>
>
>
>



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:35:40 EDT