LinuxQuestions.org
Register a domain and help support LQ
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
 
LinkBack Search this Thread
Old 11-13-2004, 10:46 PM   #1
captainObvious
LQ Newbie
 
Registered: Nov 2004
Posts: 9

Rep: Reputation: 0
Unhappy Running java myprogram from the bash shell


Hi,
I've got linux enterprise (fedora 2 right?)...
I always receive the usage: info everyting I try to run my program from the command line?

Even when I do java ? or java -version

I get the usage: info

Here is how I set it up. I downloaded jsdk 1.5
then when I did java I would get the script.....

#!/bin/sh

echo "libgcj-java-placeholder.sh"
echo
echo "This script is a placeholder for the /usr/bin/java and /usr/bin/javac"
echo "master links required by jpackage.org conventions. libgcj's"
echo "rmiregistry, rmic and jar tools are now slave symlinks to these"
echo "masters, and are managed by the alternatives(8) system."
echo
echo "This change was necessary because the rmiregistry, rmic and jar tools"
echo "installed by previous versions of libgcj conflicted with symlinks"
echo "installed by jpackage.org JVM packages."


I commented out echo and added ....


#!/bin/sh

#echo "libgcj-java-placeholder.sh"
#echo
#echo "This script is a placeholder for the /usr/bin/java and /usr/bin/javac"
#echo "master links required by jpackage.org conventions. libgcj's"
#echo "rmiregistry, rmic and jar tools are now slave symlinks to these"
#echo "masters, and are managed by the alternatives(8) system."
#echo
#echo "This change was necessary because the rmiregistry, rmic and jar tools"
#echo "installed by previous versions of libgcj conflicted with symlinks"
#echo "installed by jpackage.org JVM packages."

exec /opt/jdk1.5.0/bin/java


Thats how I have it working but not working ???

Please help

thanks
 
Old 11-24-2004, 02:06 PM   #2
brainlesspinkey
Member
 
Registered: Jul 2004
Distribution: Debian Unstable
Posts: 66

Rep: Reputation: 15
what i did for my install of java, was to first take out that script you had:
(as root)
mkdir /usr/javabkup
mv /usr/bin/java /usr/javabkup
mv /usr/bin/javac /usr/javabkup
Then, I made symblinks for jsdk.
ln -s %location of j2sdk%/bin/* /usr/bin/
then you should be able to run java or javac etc from anywhere
-pink

-try it, it might work...-
 
Old 11-24-2004, 03:22 PM   #3
caps_phisto
Member
 
Registered: Sep 2004
Location: NH
Distribution: FC6, FC1-4, RH9, Gentoo 2006.0/1, Slackware 10.1/2,11, Vector SOHO 5.0.1
Posts: 237

Rep: Reputation: 30
You may need to alter your PATH variable and add the path to your java executables to it.
This is how I did it:

Code:
export PATH=$PATH:/usr/j2sdk1.4.2_06/bin
This will allow Linux to do all the work to find javac and the other executables.

Hope this helps
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running shell scripts from Java cmpich Programming 1 04-19-2005 04:36 AM
running shell scripts using Java niravk8 Programming 2 02-09-2005 09:42 AM
running SHell script from java anirudh Programming 2 01-07-2005 07:37 AM
What is Bash shell? xailer Linux - Newbie 4 11-23-2003 09:29 AM
Running Java Socket Program in a shell during bootup TomCruise2002 Linux - Newbie 1 10-15-2002 10:28 PM


All times are GMT -5. The time now is 12:47 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