My system can't find Java tools
I installed Java SDK 1.4.2_07 a year or so ago on my Mandrake 10 Linux system in;
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?