Swing runtime problems / Java installation problems - Java

This is a discussion on Swing runtime problems / Java installation problems - Java ; Hello all. I have a very simple problem. I am seeking to develop java apps on mepis linux (ver. 3.4-3). I have installed jdk 1.6.0 and i am having runtime error problems. It seems like a simple matter, but i ...

+ Reply to Thread
Results 1 to 10 of 10

Swing runtime problems / Java installation problems

  1. Default Swing runtime problems / Java installation problems

    Hello all. I have a very simple problem. I am seeking to develop
    java apps on mepis linux (ver. 3.4-3). I have installed jdk 1.6.0 and
    i am having runtime error problems. It seems like a simple matter,
    but i do not know how to solve the problem i am having. I have
    compiled the following code directly from the sun website...

    package start;

    /*
    * HelloWorldSwing.java requires no other files.
    */
    import javax.swing.*;

    public class HelloWorldSwing {
    /**
    * Create the GUI and show it. For thread safety,
    * this method should be invoked from the
    * event-dispatching thread.
    */
    private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("HelloWorldSwing");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //Add the ubiquitous "Hello World" label.
    JLabel label = new JLabel("Hello World");
    frame.getContentPane().add(label);

    //Display the window.
    frame.pack();
    frame.setVisible(true);
    }

    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    }
    });
    }
    }


    when i compile, nothing seems to be wrong...

    Aesotericon@5[HelloWorldSwing]$ ls
    HelloWorldSwing.java
    Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    bin/javac HelloWorldSwing.java
    Aesotericon@5[HelloWorldSwing]$ ls
    HelloWorldSwing$1.class HelloWorldSwing.class HelloWorldSwing.java
    Aesotericon@5[HelloWorldSwing]$

    when i try to run the program the following happens...

    Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    bin/java HelloWorldSwing
    Exception in thread "main" java.lang.NoClassDefFoundError:
    HelloWorldSwing (wrong name: start/HelloWorldSwing)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
    124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:
    260)
    at java.net.URLClassLoader.access$000(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:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
    276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
    319)
    Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    bin/java .HelloWorldSwing
    Exception in thread "main" java.lang.NoClassDefFoundError: /
    HelloWorldSwing
    Aesotericon@5[HelloWorldSwing]$ unset CLASSPATH
    Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    bin/java HelloWorldSwing
    Exception in thread "main" java.lang.NoClassDefFoundError:
    HelloWorldSwing (wrong name: start/HelloWorldSwing)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
    124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:
    260)
    at java.net.URLClassLoader.access$000(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:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
    276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
    319)
    Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    bin/java .HelloWorldSwing
    Exception in thread "main" java.lang.NoClassDefFoundError: /
    HelloWorldSwing

    As you all see, I have tried several methods of running the program,
    but it will not work. I feel like a simpleton, but does anyone have
    any suggestions? It seems that java is having a hard time finding
    my .class file. I dunno...

    J.P.


  2. Default Re: Swing runtime problems / Java installation problems

    Johnny Danger wrote:
    >Hello all. I have a very simple problem. I am seeking to develop
    >java apps on mepis linux (ver. 3.4-3). I have installed jdk 1.6.0 and
    >i am having runtime error problems.

    ...
    >package start;

    ...
    >Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    >bin/java HelloWorldSwing


    The fully qualified name of this class is 'start.HelloWorldSwing'.

    Perhaps you might run it using
    ...java start.HellowWorldSwing

    OTOH - I guess then you will be getting a 'wrong package'
    or similar error.

    As an initial test, I would recommend commenting out
    or removing the package statement, then recompiling it
    and trying again with.
    ...java HelloWorldSwing

    Then you might (later) figure how to compile and run
    packaged code.
    ...
    >As you all see, I have tried several methods of running the program,
    >but it will not work. I feel like a simpleton, but does anyone have
    >any suggestions? It seems that java is having a hard time finding
    >my .class file. I dunno...


    For best help, it is advisable to use the more
    common forms of expressions (no 'slang').
    Note that *many* of the people who contribute
    to these forums speak Engilsh as a Second
    (3rd.. etc.) Language, and might not recognise
    'dunno' as 'do not know'. Also, many of us who
    *do* speak English as a native tongue, simply
    don't like seeing such abbreviations.

    That being said, I myself occasionally use slang
    words, but usually only in replies to people whom
    I am confident would understand what I mean.

    (Oh, and the word 'I' should always be Upper Case
    in English - *always*.)

    --
    Andrew Thompson
    http://www.athompson.info/andrew/

    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.asp...setup/200709/1


  3. Default Re: Swing runtime problems / Java installation problems

    On Sep 21, 12:04 am, "Andrew Thompson" <u32984@uwe> wrote:
    > Johnny Danger wrote:
    > >Hello all. I have a very simple problem. I am seeking to develop
    > >java apps on mepis linux (ver. 3.4-3). I have installed jdk 1.6.0 and
    > >i am having runtime error problems.

    > ..
    > >package start;

    > ..
    > >Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    > >bin/java HelloWorldSwing

    >
    > The fully qualified name of this class is 'start.HelloWorldSwing'.
    >
    > Perhaps you might run it using
    > ..java start.HellowWorldSwing
    >
    > OTOH - I guess then you will be getting a 'wrong package'
    > or similar error.
    >
    > As an initial test, I would recommend commenting out
    > or removing the package statement, then recompiling it
    > and trying again with.
    > ..java HelloWorldSwing
    >
    > Then you might (later) figure how to compile and run
    > packaged code.
    > ..
    >
    > >As you all see, I have tried several methods of running the program,
    > >but it will not work. I feel like a simpleton, but does anyone have
    > >any suggestions? It seems that java is having a hard time finding
    > >my .class file. I dunno...

    >
    > For best help, it is advisable to use the more
    > common forms of expressions (no 'slang').
    > Note that *many* of the people who contribute
    > to these forums speak Engilsh as a Second
    > (3rd.. etc.) Language, and might not recognise
    > 'dunno' as 'do not know'. Also, many of us who
    > *do* speak English as a native tongue, simply
    > don't like seeing such abbreviations.
    >
    > That being said, I myself occasionally use slang
    > words, but usually only in replies to people whom
    > I am confident would understand what I mean.
    >
    > (Oh, and the word 'I' should always be Upper Case
    > in English - *always*.)
    >
    > --
    > Andrew Thompsonhttp://www.athompson.info/andrew/
    >
    > Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-setup/200709/1



    please limit replies to those directly relating to the conversation at
    hand...


  4. Default Re: Swing runtime problems / Java installation problems

    On Sep 21, 12:45 am, Johnny Danger <jpaez1...@gmail.com> wrote:
    > On Sep 21, 12:04 am, "Andrew Thompson" <u32984@uwe> wrote:
    >
    >
    >
    > > Johnny Danger wrote:
    > > >Hello all. I have a very simple problem. I am seeking to develop
    > > >java apps on mepis linux (ver. 3.4-3). I have installed jdk 1.6.0 and
    > > >i am having runtime error problems.

    > > ..
    > > >package start;

    > > ..
    > > >Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    > > >bin/java HelloWorldSwing

    >
    > > The fully qualified name of this class is 'start.HelloWorldSwing'.

    >
    > > Perhaps you might run it using
    > > ..java start.HellowWorldSwing

    >
    > > OTOH - I guess then you will be getting a 'wrong package'
    > > or similar error.

    >
    > > As an initial test, I would recommend commenting out
    > > or removing the package statement, then recompiling it
    > > and trying again with.
    > > ..java HelloWorldSwing

    >
    > > Then you might (later) figure how to compile and run
    > > packaged code.
    > > ..

    >
    > > >As you all see, I have tried several methods of running the program,
    > > >but it will not work. I feel like a simpleton, but does anyone have
    > > >any suggestions? It seems that java is having a hard time finding
    > > >my .class file. I dunno...

    >
    > > For best help, it is advisable to use the more
    > > common forms of expressions (no 'slang').
    > > Note that *many* of the people who contribute
    > > to these forums speak Engilsh as a Second
    > > (3rd.. etc.) Language, and might not recognise
    > > 'dunno' as 'do not know'. Also, many of us who
    > > *do* speak English as a native tongue, simply
    > > don't like seeing such abbreviations.

    >
    > > That being said, I myself occasionally use slang
    > > words, but usually only in replies to people whom
    > > I am confident would understand what I mean.

    >
    > > (Oh, and the word 'I' should always be Upper Case
    > > in English - *always*.)

    >
    > > --
    > > Andrew Thompsonhttp://www.athompson.info/andrew/

    >
    > > Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-setup/200709/1

    >
    > please limit replies to those directly relating to the conversation at
    > hand...


    got a *useful* reply to this question on another thread. 'thanx'
    anyway. i really appreciate it.


  5. Default java runtime problems

    On Sep 21, 5:00 pm, Johnny Danger <jpaez1...@gmail.com> wrote:
    > On Sep 21, 12:45 am, Johnny Danger <jpaez1...@gmail.com> wrote:
    > > On Sep 21, 12:04 am, "Andrew Thompson" <u32984@uwe> wrote:

    >
    > > > Johnny Danger wrote:
    > > > >Hello all. I have a very simple problem.


    Being a multi-poster is a fairly siple problem to
    fix. Your other problems, incluung the over
    inflated sense of self entitlement, are more
    tricky.

    > > >I am seeking to develop
    > > > >java apps on mepis linux (ver. 3.4-3). I have installed jdk 1.6.0 and
    > > > >i am having runtime error problems.
    > > > ..
    > > > >package start;
    > > > ..
    > > > >Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    > > > >bin/java HelloWorldSwing

    >
    > > > The fully qualified name of this class is 'start.HelloWorldSwing'.

    >
    > > > Perhaps you might run it using
    > > > ..java start.HellowWorldSwing

    >
    > > > OTOH - I guess then you will be getting a 'wrong package'
    > > > or similar error.

    >
    > > > As an initial test, I would recommend commenting out
    > > > or removing the package statement, then recompiling it
    > > > and trying again with.
    > > > ..java HelloWorldSwing

    >
    > > > Then you might (later) figure how to compile and run
    > > > packaged code.
    > > > ..

    >
    > > > >As you all see, I have tried several methods of running the program,
    > > > >but it will not work. I feel like a simpleton, but does anyone have
    > > > >any suggestions? It seems that java is having a hard time finding
    > > > >my .class file. I dunno...

    >
    > > > For best help, it is advisable to use the more
    > > > common forms of expressions (no 'slang').
    > > > Note that *many* of the people who contribute
    > > > to these forums speak Engilsh as a Second
    > > > (3rd.. etc.) Language, and might not recognise
    > > > 'dunno' as 'do not know'. Also, many of us who
    > > > *do* speak English as a native tongue, simply
    > > > don't like seeing such abbreviations.

    >
    > > > That being said, I myself occasionally use slang
    > > > words, but usually only in replies to people whom
    > > > I am confident would understand what I mean.

    >
    > > > (Oh, and the word 'I' should always be Upper Case
    > > > in English - *always*.)

    ....
    > > please limit replies to those directly relating to the conversation at
    > > hand...


    Pleas get yourself a help-desk. These are
    discussion forums.

    > got a *useful* reply to this question on another thread.


    Sure you did. Six minutes later than my
    reply on your first thread, that pointed
    out the same thing.

    (Title changed, and x-posted to c.l.j.p./h.
    in effots to combine the multi-post, with
    follow-ups to c.l.j.h. only)

    Andrew T.


  6. Default java runtime problems

    On Sep 21, 5:00 pm, Johnny Danger <jpaez1...@gmail.com> wrote:
    > On Sep 21, 12:45 am, Johnny Danger <jpaez1...@gmail.com> wrote:
    > > On Sep 21, 12:04 am, "Andrew Thompson" <u32984@uwe> wrote:

    >
    > > > Johnny Danger wrote:
    > > > >Hello all. I have a very simple problem.


    Being a multi-poster is a fairly siple problem to
    fix. Your other problems, incluung the over
    inflated sense of self entitlement, are more
    tricky.

    > > >I am seeking to develop
    > > > >java apps on mepis linux (ver. 3.4-3). I have installed jdk 1.6.0 and
    > > > >i am having runtime error problems.
    > > > ..
    > > > >package start;
    > > > ..
    > > > >Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    > > > >bin/java HelloWorldSwing

    >
    > > > The fully qualified name of this class is 'start.HelloWorldSwing'.

    >
    > > > Perhaps you might run it using
    > > > ..java start.HellowWorldSwing

    >
    > > > OTOH - I guess then you will be getting a 'wrong package'
    > > > or similar error.

    >
    > > > As an initial test, I would recommend commenting out
    > > > or removing the package statement, then recompiling it
    > > > and trying again with.
    > > > ..java HelloWorldSwing

    >
    > > > Then you might (later) figure how to compile and run
    > > > packaged code.
    > > > ..

    >
    > > > >As you all see, I have tried several methods of running the program,
    > > > >but it will not work. I feel like a simpleton, but does anyone have
    > > > >any suggestions? It seems that java is having a hard time finding
    > > > >my .class file. I dunno...

    >
    > > > For best help, it is advisable to use the more
    > > > common forms of expressions (no 'slang').
    > > > Note that *many* of the people who contribute
    > > > to these forums speak Engilsh as a Second
    > > > (3rd.. etc.) Language, and might not recognise
    > > > 'dunno' as 'do not know'. Also, many of us who
    > > > *do* speak English as a native tongue, simply
    > > > don't like seeing such abbreviations.

    >
    > > > That being said, I myself occasionally use slang
    > > > words, but usually only in replies to people whom
    > > > I am confident would understand what I mean.

    >
    > > > (Oh, and the word 'I' should always be Upper Case
    > > > in English - *always*.)

    ....
    > > please limit replies to those directly relating to the conversation at
    > > hand...


    Pleas get yourself a help-desk. These are
    discussion forums.

    > got a *useful* reply to this question on another thread.


    Sure you did. Six minutes later than my
    reply on your first thread, that pointed
    out the same thing.

    (Title changed, and x-posted to c.l.j.p./h.
    in effots to combine the multi-post, with
    follow-ups to c.l.j.h. only)

    Andrew T.


  7. Default Re: Swing runtime problems / Java installation problems

    Johnny Danger wrote:
    > please limit replies to those directly relating to the conversation at
    > hand...


    What are you, the topic police?

    Andrew's replies were relevant, and helpful if you take them right.

    --
    Lew

  8. Default Re: java runtime problems

    On Sep 21, 3:24 am, Andrew Thompson <andrewtho...@gmail.com> wrote:
    > On Sep 21, 5:00 pm, Johnny Danger <jpaez1...@gmail.com> wrote:
    >
    > > On Sep 21, 12:45 am, Johnny Danger <jpaez1...@gmail.com> wrote:
    > > > On Sep 21, 12:04 am, "Andrew Thompson" <u32984@uwe> wrote:

    >
    > > > > Johnny Danger wrote:
    > > > > >Hello all. I have a very simple problem.

    >
    > Being a multi-poster is a fairly siple problem to
    > fix.


    Nor is it an obviously relevant one here.

    [unprovoked insults aimed at the OP snipped]

    [lots of quoted material snipped, most of which is totally bogus --
    none of the other articles in this thread contain e.g. this:]

    > > > > That being said, I myself occasionally use slang
    > > > > words, but usually only in replies to people whom
    > > > > I am confident would understand what I mean.

    >
    > > > > (Oh, and the word 'I' should always be Upper Case
    > > > > in English - *always*.)

    > ...
    > > > please limit replies to those directly relating to the conversation at
    > > > hand...


    [snip rest]

    > Pleas get yourself a help-desk. These are
    > discussion forums.


    The original post seemed perfectly polite and on-topic to me. It is
    detailed; it even contains an SSCCE. Yet you respond not only
    negatively, but in a manner that makes it seem you are actually
    replying to something else entirely and your reply was posted to the
    wrong thread.

    Your response is frankly baffling, Andrew.

    AFAICT, either you posted your response to thread A into thread B, or
    at least you're referencing events in thread A in thread B instead of
    confining your reply in thread B to subject matter raised in thread B.
    Thread B in this case not having previously involved any grammar
    quibbles, nor any of the other mostly non-Java-related things you rave
    and ramble on about in your post.

    Contrast your response with Gordon's, which follows quite logically
    from the OP's post and which resulted in a polite thank-you from the
    OP.


  9. Default Re: Swing runtime problems / Java installation problems

    On Thu, 20 Sep 2007 22:39:39 -0700, Johnny Danger
    <jpaez1020@gmail.com> wrote, quoted or indirectly quoted someone who
    said :

    >Aesotericon@5[HelloWorldSwing]$ /home/Aesotericon/Documents/jdk1.6.0/
    >bin/java HelloWorldSwing


    your class's name is start.HelloWorldSwing not HelloWorldSwing

    see
    http://mindprod.com/jgloss/runerrorm...SDEFFOUNDERROR
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com

  10. Default Re: Swing runtime problems / Java installation problems

    On Fri, 21 Sep 2007 07:00:13 -0000, Johnny Danger
    <jpaez1020@gmail.com> wrote, quoted or indirectly quoted someone who
    said :

    >
    >got a *useful* reply to this question on another thread. 'thanx'
    >anyway. i really appreciate it.


    Like gold, the good stuff usually comes with a "ore" you have to dig
    through. If you are rude to people who give you less than perfect
    answers, you will find not just that person, but others won't answer
    you pleas in future because they don't want to risk being chastised
    for imperfection.

    Keep in mind you are not ENTITLED to any answer at all. ANYTHING you
    get is a gift. If you start acting in the least like a little
    potentate ordering around the servants, you will head straight to the
    killfiles.

    As you will likely be reminded many times in future, this is not a
    help desk. This is a discussion group. Your posts are merely fodder
    for the free-ranging discussion, not commands to the staff. If some
    of it turns out to be useful to you, that is a lucky happenstance.

    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com

+ Reply to Thread

Similar Threads

  1. java runtime problems
    By Application Development in forum Java
    Replies: 2
    Last Post: 09-21-2007, 01:55 AM
  2. Swing Appearance Problems
    By Application Development in forum Java
    Replies: 14
    Last Post: 08-16-2007, 10:17 AM
  3. PHP Installation Problems
    By Application Development in forum PHP
    Replies: 11
    Last Post: 07-31-2007, 09:06 AM
  4. i need help about .net installation problems
    By Application Development in forum DOTNET
    Replies: 1
    Last Post: 12-09-2006, 04:12 AM
  5. Replies: 0
    Last Post: 04-01-2004, 12:44 PM