Run a compiled class


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: Run a compiled class

Hybrid View

  1. #1
    Robert Levy Guest

    Run a compiled class


    Hello

    I am trying to run a compiled class and I am getting the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: Jabberwock/class

    Does anybody know how I can fix this?

    Thanks in advance

    Robert

  2. #2
    mikem Guest

    Re: Run a compiled class


    my guess is that you are using this command line

    java Jabberwock.class

    this is incorrect. this tells the VM to find a class called "class" in package
    "Jabberwock". Eliminate the ".class" from the command line (i.e. java Jabberwock)
    and it should work. note, i am assuming you are using the default package.

    cheers,
    mike

    "Robert Levy" <rlevy@sympatico.ca> wrote:
    >
    >Hello
    >
    >I am trying to run a compiled class and I am getting the following error:
    >Exception in thread "main" java.lang.NoClassDefFoundError: Jabberwock/class
    >
    >Does anybody know how I can fix this?
    >
    >Thanks in advance
    >
    >Robert



  3. #3
    bhupesh Guest

    Re: Run a compiled class


    "Robert Levy" <rlevy@sympatico.ca> wrote:
    >
    >Hello
    >
    >I am trying to run a compiled class and I am getting the following error:
    >Exception in thread "main" java.lang.NoClassDefFoundError: Jabberwock/class
    >
    >Does anybody know how I can fix this?
    >
    >Thanks in advance
    >
    >Robert

    give details about ur program whats ur program suppose to be doing


  4. #4
    Friends Guest

    Re: Run a compiled class


    Chech your classPath environment variable.

    "Robert Levy" <rlevy@sympatico.ca> wrote:
    >
    >Hello
    >
    >I am trying to run a compiled class and I am getting the following error:
    >Exception in thread "main" java.lang.NoClassDefFoundError: Jabberwock/class
    >
    >Does anybody know how I can fix this?
    >
    >Thanks in advance
    >
    >Robert



  5. #5
    Ravi Guest

    Re: Run a compiled class


    Hello Robert

    Check your class name, should match exactly with the file name and define
    classpath properly.


    "Friends" <robinsonstud@yahoo.com> wrote:
    >
    >Chech your classPath environment variable.
    >
    >"Robert Levy" <rlevy@sympatico.ca> wrote:
    >>
    >>Hello
    >>
    >>I am trying to run a compiled class and I am getting the following error:
    >>Exception in thread "main" java.lang.NoClassDefFoundError: Jabberwock/class
    >>
    >>Does anybody know how I can fix this?
    >>
    >>Thanks in advance
    >>
    >>Robert

    >



  6. #6
    Rajeev Guest

    Re: Run a compiled class


    I agree with the answer.


    "Ravi" <ravisco@usa.net> wrote:
    >
    >Hello Robert
    >
    >Check your class name, should match exactly with the file name and define
    >classpath properly.
    >
    >
    >"Friends" <robinsonstud@yahoo.com> wrote:
    >>
    >>Chech your classPath environment variable.
    >>
    >>"Robert Levy" <rlevy@sympatico.ca> wrote:
    >>>
    >>>Hello
    >>>
    >>>I am trying to run a compiled class and I am getting the following error:
    >>>Exception in thread "main" java.lang.NoClassDefFoundError: Jabberwock/class
    >>>
    >>>Does anybody know how I can fix this?
    >>>
    >>>Thanks in advance
    >>>
    >>>Robert

    >>

    >



  7. #7
    RadhaKrishnan Guest

    Re: Run a compiled class


    Dear Robert,
    The problem can be because of two reasons.

    1. Your classpath may not be set to include the current directory. To set
    the classpath the current directory do the following.
    > set classpath=%classpath%;.

    The . represents the current directory.

    2. You are executing the class like this ->
    java programname.class.
    Do not include the .class extension when you execute. Just say,

    java programname.

    Bye
    RK


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center