Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run a class outside JDeveloper IDE

 
Bob Fike
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic