File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes  question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark " question" Watch " question" New topic


Tmmet Johnson
Ranch Hand

Joined: Nov 03, 2004
Posts: 56
This could be a stupid question.
Can anyone help me out?
I have jre installed in Unix machine.
My question is
Do I have to set $PATH in my .sh file to run the java program?
I am getting java.lang.NoClassDefFOundError.JRE not found.I know it is not able to identify the JRE.
Can anyone throw some light on this issue?

Thanks in advance,
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2398
Can you elaborate more on what the name of the class is and what you typed at the command line?
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
What happens when you type
java -version
at the command prompt?

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Tmmet Johnson
Ranch Hand

Joined: Nov 03, 2004
Posts: 56
When I type java -version, I get jdk1.5.
Why I get JRE not found error.I though we need $PATH to be set explicitly only if I compile my java program in that machine.If I just run my Java Program , I don't need the $PATH to be set as $CLASSPATH will take care of it know.Please correct me if I am wrong.
Thanks in advance,
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

The fact that you can type "java -version" and see "1.5" means that PATH is already set properly.

There is no program named "JRE" or "jre". The "JRE", the "Java Runtime Environment" includes the "java" application launcher, the Java runtime libraries, and other components needed to run Java software. The "JDK" or "J2SDK", the "Java Development Kit", includes everything that's in the JRE, plus the Java compiler javac and other development tools.

[Jess in Action][AskingGoodQuestions]
Tmmet Johnson
Ranch Hand

Joined: Nov 03, 2004
Posts: 56
thanks for the answers.
I agree. Here's the link:
subject: question
It's not a secret anymore!