Re: CLI Java Glitch

Discussion in 'Java' started by Tom Anderson, Jun 21, 2011.

  1. Tom Anderson

    Tom Anderson Guest

    On Mon, 20 Jun 2011, Gene Wirchenko wrote:

    > Dear Java'ers:
    >
    > Given
    >
    > class HelloWorld
    > {
    > public static void main(String[] args)
    > {
    > System.out.println("Hello, world!");
    > }
    > }
    >
    > is there any way around the following?
    >
    > C:\cbs2dev\test>java helloworld
    > Exception in thread "main" java.lang.NoClassDefFoundError: helloworld
    > (wrong nam
    > e: HelloWorld)
    > at java.lang.ClassLoader.defineClass1(Native Method)
    > at java.lang.ClassLoader.defineClassCond(Unknown Source)
    > 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$000(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)
    > Could not find the main class: helloworld. Program will exit.


    Yes:

    http://fedoraproject.org/get-fedora

    I'm serious. Your operating system is broken. Get one that isn't.

    tom

    --
    No man ever steps in the same river twice, for it's not the same river
    and he's not the same man. -- Heraclitus
    Tom Anderson, Jun 21, 2011
    #1
    1. Advertising

  2. On Tue, 21 Jun 2011 22:42:26 +0100, Tom Anderson
    <> wrote:

    [snip]

    >Yes:
    >
    >http://fedoraproject.org/get-fedora
    >
    >I'm serious. Your operating system is broken. Get one that isn't.


    I do not nuke mosquitos. If I switched operating systems every
    time that something did not work quite as I wanted, I would waste a
    lot of time.

    Sincerely,

    Gene Wirchenko
    Gene Wirchenko, Jun 21, 2011
    #2
    1. Advertising

  3. Tom Anderson

    Arne Vajhøj Guest

    On 6/21/2011 5:42 PM, Tom Anderson wrote:
    > On Mon, 20 Jun 2011, Gene Wirchenko wrote:
    >> Dear Java'ers:
    >>
    >> Given
    >>
    >> class HelloWorld
    >> {
    >> public static void main(String[] args)
    >> {
    >> System.out.println("Hello, world!");
    >> }
    >> }
    >>
    >> is there any way around the following?
    >>
    >> C:\cbs2dev\test>java helloworld
    >> Exception in thread "main" java.lang.NoClassDefFoundError: helloworld
    >> (wrong nam
    >> e: HelloWorld)
    >> at java.lang.ClassLoader.defineClass1(Native Method)
    >> at java.lang.ClassLoader.defineClassCond(Unknown Source)
    >> 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$000(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)
    >> Could not find the main class: helloworld. Program will exit.

    >
    > Yes:
    >
    > http://fedoraproject.org/get-fedora


    He would get a different exception, but still an exception, so ...

    Arne
    Arne Vajhøj, Jul 22, 2011
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Ram

    Re: CLI Java Glitch

    Stefan Ram, Jun 20, 2011, in forum: Java
    Replies:
    2
    Views:
    294
    Stefan Ram
    Jun 21, 2011
  2. Martin Gregorie

    Re: CLI Java Glitch

    Martin Gregorie, Jun 20, 2011, in forum: Java
    Replies:
    54
    Views:
    1,281
    Andreas Leitgeb
    Jul 25, 2011
  3. Jeff Higgins

    Re: CLI Java Glitch

    Jeff Higgins, Jun 21, 2011, in forum: Java
    Replies:
    9
    Views:
    373
    Tom Anderson
    Jun 21, 2011
  4. Roedy Green

    Re: CLI Java Glitch

    Roedy Green, Jun 21, 2011, in forum: Java
    Replies:
    9
    Views:
    312
    Arne Vajhøj
    Jul 22, 2011
  5. Jeff Higgins

    Re: CLI Java Glitch

    Jeff Higgins, Jun 22, 2011, in forum: Java
    Replies:
    8
    Views:
    396
    Arne Vajhøj
    Jul 22, 2011
Loading...

Share This Page