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

JavaComm and NetBeans

2 views
Skip to first unread message

Wes Crucius

unread,
Nov 9, 2001, 11:32:20 AM11/9/01
to
I am getting the following error trying to run the JavaComm
"SimpleDemo" code from within Netbeans. It does compile successfully,
and it does run from command line.

java.lang.NoClassDefFoundError: samples/SerialDemo/SerialDemo (wrong
name: SerialDemo)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
Exception in thread "main"

Also, I have put each of the appropriate JavaComm files in each of the
JVM trees:
C:\Program Files\JavaSoft\jre\1.3.1\bin\Win32com.dll
C:\Program Files\JavaSoft\jre\1.3.1\lib\javax.comm.properties
C:\Program Files\JavaSoft\jre\1.3.1\lib\ext\comm.jar

C:\Java\jdk1.3.1_01\bin
C:\Java\jdk1.3.1_01\bin\lib
C:\Java\jdk1.3.1_01\bin\lib\ext

C:\Java\jdk1.3.1_01\jre\bin
C:\Java\jdk1.3.1_01\jre\lib
C:\Java\jdk1.3.1_01\jre\lib\ext


Any help would be greatly appreciated.
Thanks,
Wes

Jon Skeet

unread,
Nov 9, 2001, 12:11:58 PM11/9/01
to
Wes Crucius <wcru...@sandc.com> wrote:
> I am getting the following error trying to run the JavaComm
> "SimpleDemo" code from within Netbeans. It does compile successfully,
> and it does run from command line.
>
> java.lang.NoClassDefFoundError: samples/SerialDemo/SerialDemo (wrong
> name: SerialDemo)
> at java.lang.ClassLoader.defineClass0(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
> Exception in thread "main"

That just shows that the classpath is wrong. You're trying to run it as
if it were a class samples.SerialDemo.SerialDemo, when in fact it's just
SerialDemo - ie put samples/SerialDemo in the classpath instead of the
directory above samples.

It strikes me that runnning demo code is a lot easier from *outside* an
IDE than from inside one, precisely because of issues like this.

[Removed comp.lang.java.developer, which isn't a valid newsgroup.]

--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Wes Crucius

unread,
Nov 10, 2001, 12:16:41 AM11/10/01
to
Thanks Jon. I ended up getting it to work by putting "package
SerialDemo" in each of the related .java files. BTW, I agree that it
is easier to run demo code at command line, but that's the whole
point... if I can't that working in the IDE, it's a bit of a lost
cause, don't you think.

Anyway, I have another problem if you're feeling lucky: trying to run
NB3.2.1 in Linux using the IBM JDK. It launches the splash screen and
then hangs. Any ideas?

Jon Skeet <sk...@pobox.com> wrote in message news:<MPG.16561eba3...@mrmog.peramon.com>...

Jon Skeet

unread,
Nov 10, 2001, 2:40:49 AM11/10/01
to
Wes Crucius <wcru...@sandc.com> wrote:
> Thanks Jon. I ended up getting it to work by putting "package
> SerialDemo" in each of the related .java files. BTW, I agree that it
> is easier to run demo code at command line, but that's the whole
> point... if I can't that working in the IDE, it's a bit of a lost
> cause, don't you think.

No, not really. It's generally easier to organise your own code in a way
that the IDE likes than it is to persuade the IDE to accept how someone
else has organised their code. Shame, but true.



> Anyway, I have another problem if you're feeling lucky: trying to run
> NB3.2.1 in Linux using the IBM JDK. It launches the splash screen and
> then hangs. Any ideas?

NB3.2.1? What's that?

Linda Radecke

unread,
Nov 10, 2001, 10:58:41 AM11/10/01
to

Jon Skeet wrote:

> Wes Crucius <wcru...@sandc.com> wrote:

[...]

> > Anyway, I have another problem if you're feeling lucky: trying to run
> > NB3.2.1 in Linux using the IBM JDK. It launches the splash screen and
> > then hangs. Any ideas?

> NB3.2.1? What's that?

This is the latest release of NetBeans:

http://www.netbeans.org/downloads.html


Linda
--
_ " _ When the fantasy bells of the universe ring You can
(_\|/_) fly through the sky on a dragonfly's wing - There is
(/|\) magic within, there is magic without
Kate Bush, The Magician of Lublin

Joe

unread,
Nov 14, 2001, 1:52:30 PM11/14/01
to
psst did you hear what Wes Crucius said

> Thanks Jon. I ended up getting it to work by putting "package
> SerialDemo" in each of the related .java files. BTW, I agree that it
> is easier to run demo code at command line, but that's the whole
> point... if I can't that working in the IDE, it's a bit of a lost
> cause, don't you think.

you didn't mount the right directory. If there was no package defined for
the JavaComm samples you mount the directory that the files are in.
Everything should have worked fine then.
--
Joe

"I bent my wookie" - Ralph Wiggum

0 new messages