Results 1 to 3 of 3

Thread: What next?

  1. #1
    ivlatt is offline Member
    Join Date
    Apr 2011
    Posts
    12
    Rep Power
    0

    Default "main" java.lang.NoClassDefFoundError

    Hi all

    I have somewhat completed a project in Netbeans and now want to package it in to a Jar file and test it on my web server, although I am unclear of how to do this.

    You would think they would run through this at University instead of just teaching you how to code (what use is that?)

    I'm able to package my classes into a Jar file, although when I run the Jar file through the console, I get the error "Exception in thread 'main' java.lang.noClassDefFoundError". I assume this is because the main class is not defined.
    If not, please correct me.
    If so, how do I go about creating a "main class"? (or something similar to a index.html, for example)

    Thanks in advance
    Last edited by ivlatt; 04-26-2011 at 06:28 PM.

  2. #2
    ivlatt is offline Member
    Join Date
    Apr 2011
    Posts
    12
    Rep Power
    0

    Default

    Just used the following format to execute my jar file
    Java Code:
    java -jar yourJarFile.jar
    Now I get "failed to load Main-Class manifest attribute from myJarFile.jar"

  3. #3
    ivlatt is offline Member
    Join Date
    Apr 2011
    Posts
    12
    Rep Power
    0

    Default

    Edit: compiled it with Netbeans and seems to be working.

    XML Code:
    http://www.sk8ing.co.uk/dist/launch.html
    So far, so good :cool:
    Last edited by ivlatt; 04-26-2011 at 07:33 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •