javac: Command not found

Posted on 2004-10-02
Last Modified: 2013-11-23
Hello Everyone,

I just installed java j2sdk1.4.2_05 and j2re1.4.2_05 on Fedora 2 Linux using rpm utility. My java files are stored here:
       1.     /usr/java/j2sdk1.4.2_05
       2.     /usr/java/j2re1.4.2_05

When I do javac or java, I get this error:
        bash: javac: command not found.
        bash: java: command not found.

I have changed the CLASSPATH variable as:
export CLASSPATH:$CLASSPATH:/usr/java/j2sdk1.4.2_05/bin/javac:/usr/java/j2sdk1.4.2_05/bin/java

I know there is alot of online help available but I am still not able to run my application. I think I haven't actally understood what I need to do. Can someone throw some light?

Thanks for any help.
Question by:seemasharma22
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 36

Expert Comment

ID: 12209082
Hi seemasharma22,

Try setting the path to the Java directory also, not too good at BASH, but might be this:

export PATH:$PATH:/usr/java/j2sdk1.4.2_05/bin/javac:/usr/java/j2sdk1.4.2_05/bin/java

LVL 86

Accepted Solution

CEHJ earned 125 total points
ID: 12209085
YOu need to set the path as well

LVL 86

Expert Comment

ID: 12209103
If you want to do that in your .bashrc, you should do something like

EXPORT JAVA_HOME=/user/java/j2sdk1.4.2_05
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

LVL 36

Expert Comment

ID: 12209107
Ah, so THAT's how you do it. Where do you learn this stuff anyways? Thinking of changing to Linux ;)
LVL 86

Expert Comment

ID: 12209126
LVL 86

Expert Comment

ID: 12209175

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question