Results 1 to 9 of 9
  1. #1
    Tylers Pur3 is offline Member
    Join Date
    Aug 2010
    Posts
    4
    Rep Power
    0

    Exclamation Truncated Class File Error

    Hey everyone, im pretty noobish when it comes to java. Im making a RSPS (Runescape Private Server) Some of you may know what that is, but i compiled it and then i open my run.bat and i get this error

    Java Code:
    Starting System...
    Enforcing client requirement.
    Settings Loaded Seccessfully!
    Online.
    Handlers Finished Loading
    Exception in thread "main" java.lang.ClassFormatError: Truncated class file
            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)
            at server.main(server.java:182)
    Exception in thread "Thread-4" java.lang.ClassFormatError: Truncated class file
            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)
            at NPC.getNextWalkingDirection(NPC.java:311)
            at NPC.getNextNPCMovement(NPC.java:304)
            at NPCHandler.process(NPCHandler.java:2721)
            at process.run(process.java:15)
            at java.lang.Thread.run(Unknown Source)
    Connection from cpe-24-209-158-90.wi.res.rr.com:64772
    Fsdfdsf: making new character.

    I do not have the slightest clue on how to fix this, i just know its a java error, and i thought someone here could help me, If anyone could help me it would be MUCH appreciated.
    Last edited by Tylers Pur3; 08-03-2010 at 06:15 AM.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,458
    Rep Power
    25

    Default

    ava.lang.ClassFormatError: Truncated class file
    Don't remember seeing this error. The text says there is an error with the class file.
    Can you recompile the class file?

    How are you executing the java class files? I don't know what system outputs these messages:
    Starting System...
    Enforcing client requirement.
    Settings Loaded Seccessfully!
    Online.
    Handlers Finished Loading

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Yeah, it could be that your file is corrupted. Are you using a JAR package (bat file execute) ?

  4. #4
    Tylers Pur3 is offline Member
    Join Date
    Aug 2010
    Posts
    4
    Rep Power
    0

    Default

    Im using a .bat file to run all the files. So i think that answers Eranga's Question

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    But the *.bat file should execute either jar package or bundle of class files. What you've in your project?

  6. #6
    Tylers Pur3 is offline Member
    Join Date
    Aug 2010
    Posts
    4
    Rep Power
    0

    Default

    What you mean by "What you've in your project?"

  7. #7
    Tylers Pur3 is offline Member
    Join Date
    Aug 2010
    Posts
    4
    Rep Power
    0

    Default

    Nvm i solved.

    I had to recompile all my files again :)

    Thanks for the help you guys gave me though, much appreciated.

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by Tylers Pur3 View Post
    What you mean by "What you've in your project?"
    Actually I'm asking from you, what you are compiling/running using your *.bat file. Either a JAR file or *.class files or *.java file compilation. Your project means the working folder structure.

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by Tylers Pur3 View Post
    Nvm i solved.

    I had to recompile all my files again :)

    Thanks for the help you guys gave me though, much appreciated.
    Okay, then it's time to mark your thread as solved. :)

Similar Threads

  1. Button is sometimes truncated
    By new2java2009 in forum New To Java
    Replies: 7
    Last Post: 06-07-2010, 05:36 PM
  2. Replies: 0
    Last Post: 11-17-2009, 06:36 PM
  3. Help needed Clearing the contents of a File
    By sandeepsai17 in forum New To Java
    Replies: 5
    Last Post: 07-02-2009, 02:31 PM
  4. Replies: 4
    Last Post: 10-02-2008, 06:32 PM
  5. .class fille needed from eclipse
    By perplexingtrax in forum New To Java
    Replies: 4
    Last Post: 03-27-2008, 05:36 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
  •