wood burning stoves 2.0*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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, 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.
It is sorta covered in the JavaRanch Style Guide.
subject: How to run a class outside JDeveloper IDE
Similar Threads
No suitable driver java.sql.SQLException: No suitable driver
Executing Old Code
No console window when running manifest file?
bary ellert
javac - Why does it stop?