*
The moose likes Beginning Java and the fly likes How to run a class outside JDeveloper IDE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to run a class outside JDeveloper IDE" Watch "How to run a class outside JDeveloper IDE" New topic
Author

How to run a class outside JDeveloper IDE

Bob Fike
Greenhorn

Joined: Dec 21, 2011
Posts: 1
I have created a Java Class called pi_hourly_volumes and placed it in a package called noble_pi_projects. I did this in JDeveloper IDE. It runs fine within JDeveloper but when I try to execute the class from a command window on Windows I get:

Exception in thread "main" java.lang.NoClassDefFoundError: noble_pi_projects\pi_hourly_volumes
Could not find the main class: noble_pi_projects\pi_hourly_volumes

I did the following from a command prompt window to get this error:

cd\noble_pi_projects
java noble_pi_projects\pi_hourly_volumes

What am I doing wrong?

Thanks
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

If the class is not in a package, and the .class file is C:\x\y\Foo.class, then you execute


If the class in in a package, say, com.bar, and the .class file is C:\x\y\com\bar\Foo.class, then


Note how the root of the package is inside a classpath directory.

There should be enough there for you to google for more details and examples.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to run a class outside JDeveloper IDE