Solved

javac: Command not found

Posted on 2004-10-02
6
2,273 Views
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.
0
Comment
Question by:seemasharma22
  • 4
  • 2
6 Comments
 
LVL 36

Expert Comment

by:Zyloch
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

Regards,
Zyloch
0
 
LVL 86

Accepted Solution

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

PATH=/user/java/j2sdk1.4.2_05/bin:$PATH
0
 
LVL 86

Expert Comment

by:CEHJ
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
EXPORT PATH=$JAVA_HOME/bin:$PATH
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 36

Expert Comment

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

Expert Comment

by:CEHJ
ID: 12209126
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12209175
8-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
for i loop in grovy 1 44
JDeveloper 12c for 32 bit 4 67
Securing Jmx Console and web console 2 64
starter POM and spring-boot-starter,  spring-boot-web 2 40
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
The viewer will learn how to implement Singleton Design Pattern in Java.

932 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now