Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi, I am having a little problem with java.
When I try to compile code I have to type the
whole path to the javac compiler is./usr/java/j2sdk1.4....you get the idea.
I tried looking in the java tutorial and the
box where this discuss this error the tell
me to go to the installation page for linux.
But their isn't anything there to help me out.
It just discuses the installation process.
Also, java runtime enviroment was installed
when I installed linux so that would explain
why I don't have to type in the path for 'java'
to. How do I get around this problem?Thanks for any help.

I am not sure about this but i will try to help you.
1) thing is that change the directory to which the java is installed &then in the bin directory & then try running the compiler.

what you can do is to append /usr/java/jdk_whatever/bin to your PATH variable. Then you dont need to type whole path everytime. You can invoke compiler just by typing javac.
Now modifying path variable so that you dont have to set it everytime you reboot system is something specific to your system. I use Redhat 7.3 and there is a file name .bash_profile in my home directory. I can append that line to PATH variable there.
Basically you need to figure out where is your path variable storedFaisal

Thanks for the replies. I fiqured out one a
way from a page on the internet. What I do
is type this into my bashrc filealias jc="/usr/java/j2sdk...rest of the path"
and then on the console al I have to do is
type thisjc program.java
I'll try looking for the bash_profile, I think
I saw it somewhere someday.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |