Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Running an Application w/ a frame through an MS-DOS prompt

0 views
Skip to first unread message

Ted

unread,
Feb 22, 2005, 6:02:14 PM2/22/05
to
Hello all--

I've written a Java App that utilizes a frame component (rather than an
applet) as my container. The frame is created in one class and I add a
panel created in another class to it.

I.e.:
-public class Dice creates a JFrame to which I add a DicePanel.
-public class DicePanel is an extension of the JPanel class, and
includes all of my listeners, etc.

I know you'd launch a normal Java app (by normal, I mean w/o any
components) by typing into an MS-DOS prompt "java [classfile]", but
when I do this w/ my Dice class, it doesn't work. The project compiles
and runs correctly in the IDE (Netbeans 3.6), but not through DOS.
Anyone know how to do this?

FYI, my end-goal is to create an MS-DOS shortcut to run the
application.

Thanks a lot.

Wiseguy

unread,
Feb 22, 2005, 7:10:16 PM2/22/05
to
"Ted" <pres...@verizon.net> scribbled on the stall wall:
> Hello all--

>
> I know you'd launch a normal Java app (by normal, I mean w/o any
> components) by typing into an MS-DOS prompt "java [classfile]", but
> when I do this w/ my Dice class, it doesn't work. The project compiles
> and runs correctly in the IDE (Netbeans 3.6), but not through DOS.
> Anyone know how to do this?

This is most likely a classpath problem then. under m$ windoze when
you instantiate a java class from under the dos-box, and that class uses
gui awt/swing classes, it is smart enough to create and initialize the
proper widgets in the windoze gui.


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Ted

unread,
Feb 24, 2005, 1:51:13 PM2/24/05
to
Thanks, but I was hoping to not have to rework the code too much, and
I'm not sure about how to use widgets (this is one of my first gui
apps).

I should also mention that both classes are part of the same package.

This is the error message I get when I try to run the class:

Exception in thread "main" java.lang.NoClassDefFoundError: Die (wrong
name: RiggedDie/Die)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Not sure if that helps. Thanks a lot.

0 new messages