wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes how to run program in console  in a package 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 program in console  in a package" Watch "how to run program in console  in a package" New topic
Author

how to run program in console in a package

mary morris
Ranch Hand

Joined: Mar 16, 2002
Posts: 97
I have been using a small editor to compile my cattle drive programs.
Now I am trying out JBuilder8 to get experience with it. It puts everything in a package - how do you call a package from the console.
I get the following error message.
----------------
C:\JBuilder8\samples\test\classes\test>Java Say 4
Exception in thread "main" java.lang.NoClassDefFoundError: Say (wrong name: test
/Say)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
----------------------
the java class I am running from the console is
Say
the file structure is (Say.class sits in test folder) - the 2rd one
C:\JBuilder8\samples\test\classes\test
- the package is = package test;
Thanks
mary morris
Ranch Hand

Joined: Mar 16, 2002
Posts: 97
got it, I looked in other messages and found the answer there
=
C:\JBuilder8\samples\test\classes\test>cd..
C:\JBuilder8\samples\test\classes>java test.Say 4
four
C:\JBuilder8\samples\test\classes>
 
wood burning stoves
 
subject: how to run program in console in a package
 
Similar Threads
Illegal use of nonvirtual function call
About JBuilder 8 samples
JBuilder with Axis
Illegal use of nonvirtual function call
JBuilder with Axis