Results 1 to 3 of 3
I installed Java SDK 1.4.2_07 a year or so ago on my Mandrake 10 Linux system in; /usr/java/j2sdk1.4.2_07/ In /etc/profile.d/ there is a file named java.sh the contents of this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-26-2006 #1
- Join Date
- Sep 2006
My system can't find Java tools
there is a file named java.sh
the contents of this file are as follows;
I believe this script is supposed to execute at login and allow Java tools to be used from any directory.
It all worked fine. I could execute Java commands from any directory.
Recently I connected a router to provide ADSL connectivity to the Internet.
When I did this I noticed that my command prompt changed from;
As soon as the router was connected I found I could no longer get Java commands to work from anywhere.
All I get is error messages such as;
bash: java: command not found
What has happened? Has an environment variable been changed?
Here is the result of echo $PATH;
[username@myISP username]$ echo $PATH
I tried executing java.sh after changing to the directory in which it is located as follows;
[username@myISP profile.d]$ java.sh
bash: java.sh: command not found
I thought this comand would cause the script to execute, but it did not.
How do I execute this script?
I then manually executed the contents of java.sh as root by executing the line of code contained in it as a command from the command prompt as follows;
[root@myISP username]# export PATH=$PATH:/usr/java/j2sdk1.4.2_07/bin/
Then root could access Java commands OK, but only from the directory I was in when I executed the export command.
username could not access Java tools yet.
I then manually executed the contents of java.sh as username using the same method.
[username@myISP username]$ export PATH=$PATH:/usr/java/j2sdk1.4.2_07/bin/
Then username could access Java commands OK, but only from the directory I was in when I executed the export command.
After logging out and back in, the effect of these export commands had gone.
It seems that execution of the java.sh script at login is not working. Could this be asscociated with the change in host from localhost to myISP when I connected the router? This is after all the event that seemed to trigger this entire problem.
How do I cause Java tools to automatically be accessable from all directories as they once were?
- 09-27-2006 #2
Hi - Scary looking problem! I noticed you hadn't had a reply, so I'll do my best.
Have you tried - in a terminal - entering the directory containing java.sh and as root doing:
That should execute that script. When you installed your router the software you used just changed the settings for your command prompt. This is a pretty basic - and very rude - thing to do without your consent, but nothing major.I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso
- 10-01-2006 #3
- Join Date
- Sep 2006
The problem was solved as follows;
in /etc/bashrc I changed the last line from;
Why it worked I do not know. Any ideas?
Thanks to Daniel from the SLUG (Sydney Linux Users Group).
He saved my bacon.