This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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

How to run a class outside JDeveloper IDE

Bob Fike

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:

java noble_pi_projects\pi_hourly_volumes

What am I doing wrong?

Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

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,, 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.
GeeCON Prague 2014
subject: How to run a class outside JDeveloper IDE