permaculture playing cards*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark " question" Watch " question" New topic
Author

question

Tmmet Johnson
Ranch Hand

Joined: Nov 03, 2004
Posts: 56
Hi,
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: 2367
Can you elaborate more on what the name of the class is and what you typed at the command line?
Marilyn de Queiroz
Sheriff

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


JavaBeginnersFaq
"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
Hi,
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
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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
hi,
thanks for the answers.
 
wood burning stoves
 
subject: question
 
Similar Threads
Distribute Java application with JRE
JDK JRE
JDK version vs JRE version
jre & jvm
Why "lock" an app to a particluar JRE version