Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Ruben Jackson   on Mar 20 In Java Category.

  
Question Answered By: Ryan Evans   on Mar 20

You have to set the classpath in your java  command. Specifying the
java bin directory wouldn't help as mentionned previously by someone
else since this is not an error  saying "java is not recognized as an
internal or external command" but saying
a "java.lang.NoClassDefFoundError". That means your java application
cannot locate the specified class  PO.

What is a classpath? It's the directory where the java application is
looking to find a class. If you have compiled using javac command
line without any additional argument when you were in the source code
directory it should be the same directory as the source code. Look
for .class file. So if you go in the classes directory (that can be
both source and class directory as mentionned) try something like:

> java -cp . PO

Share: 

 
 
Didn't find what you were looking for? Find more on Exception in thread main? Or get search suggestion and latest updates.


Tagged: