Results 1 to 13 of 13
Like Tree1Likes
  • 1 Post By KevinWorkman

Thread: Could not find the main class error

  1. #1
    jasper580 is offline Member
    Join Date
    Mar 2012
    Posts
    7
    Rep Power
    0

    Question Could not find the main class error

    Hello everyone,
    Lil' introduction (skip it if you want ): for a few months, I'm hosting a Minecraft server. Minecraft is a pc game, and I like it really much. There is also an alternate launcher for that game, called Spout. Now I want to make a gamelauncher for the server, by editing an existing one. This one has an option to choose in the first screen, if you run the modded game, or the vanilla. Problem is, that it is overloaded with the theme from the server wherefore it was made. So I want to put my own/ the vanilla theme on it. But now I have the following problem:

    I've downloaded a jar, what runs well. Even when I convert it to zip, unpack it, repack it & convert it back to jar, it runs well. But when I convert it to zip, unpack it, edit a class file using classeditor, zip it & convert it back to jar (so just edit some class files, just simple strings who only output a Title, or send you to a webaddress or something), it gives the following error: 'Could not find the main class: net.minecraft.LauncherFrame. Program will exit.' I didn't change the manifest file, and double-checked it. I've searched a lot on Google, but all the problems with a similar message, are just by things like different OS or JDK. And I tried a lot of the given solutions, but none worked. And compiling with javac doesn't help much either. Does anyone know what to do?
    Thanks in advance, Jasper
    Last edited by jasper580; 03-07-2012 at 09:21 PM.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,038
    Rep Power
    10

    Default Re: Could not find the main class error

    Are you sure you aren't breaking any copyright laws here? What you're doing sounds pretty shady.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    jasper580 is offline Member
    Join Date
    Mar 2012
    Posts
    7
    Rep Power
    0

    Default Re: Could not find the main class error

    No. Not at all. Because if I have the permission from the original owner, I don't break any laws. If I don't get permission, I can just keep it for myself, and then I'm either not breaking copyright. The one who has written the launcher is either not breaking any laws, because he has written that launcher thing himself
    So any help please?

  4. #4
    Jeff_H is offline Member
    Join Date
    Mar 2012
    Posts
    9
    Rep Power
    0

    Default Re: Could not find the main class error

    Quote Originally Posted by KevinWorkman View Post
    Are you sure you aren't breaking any copyright laws here? What you're doing sounds pretty shady.
    Kevin, Minecraft can be modded or altered to essentially any extent; I can vouch for Jasper in this case.

    Jasper, with the limited details, i'm afraid I can't be of much help. I have one suggestion (mostly out of personal preference), try using WinRAR. I rather doubt it'll help much, but I've had issues with winzip in the past. Last I knew, winzip refuses to include files with certain extensions.

    As I said, I doubt it'll help much, but it's the best I can come up with. If you add more details, I might be able to assist further.

    Hopefully this helps solve the problem.

  5. #5
    jasper580 is offline Member
    Join Date
    Mar 2012
    Posts
    7
    Rep Power
    0

    Default Re: Could not find the main class error

    Packing it up isn't a problem. As I told, it runs fine. But when I change just one letter in a random class with classeditor, the package gives the error 'Could not find the main class file'. It's pretty hard to explain...

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,038
    Rep Power
    10

    Default Re: Could not find the main class error

    Quote Originally Posted by Jeff_H View Post
    Kevin, Minecraft can be modded or altered to essentially any extent; I can vouch for Jasper in this case.
    Right, but then why not just modify the source? Why go through all the trouble of extracting the jar, editing the class files, and attempting to sew things back together? Why not just use the source and then recompile?
    DarrylBurke likes this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    jasper580 is offline Member
    Join Date
    Mar 2012
    Posts
    7
    Rep Power
    0

    Default Re: Could not find the main class error

    Quote Originally Posted by KevinWorkman View Post
    Right, but then why not just modify the source? Why go through all the trouble of extracting the jar, editing the class files, and attempting to sew things back together? Why not just use the source and then recompile?
    Because I don't know where to find it ;)

  8. #8
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,038
    Rep Power
    10

    Default Re: Could not find the main class error

    Quote Originally Posted by jasper580 View Post
    Because I don't know where to find it ;)
    That's my point. Are you sure this project is open source? Are you supposed to be messing with these things? It really sounds like you're just trying to rebrand an existing product, which seems pretty shady. You might want to contact the developers to see if they can provide you with the source, as your current approach is just asking for all kinds of trouble- technical, legal, moral, etc.

    Edit- Here, it is open source, so use the source instead of trying to edit class files. https://github.com/SpoutDev/Spout
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  9. #9
    jasper580 is offline Member
    Join Date
    Mar 2012
    Posts
    7
    Rep Power
    0

    Default Re: Could not find the main class error

    So your answered your own question. But now comes the difficult part: Spout is not Minecraft. Actually it is rebuild from scratch. Difference is, that it looks like minecraft, and that it has support for minecraft, maps, schematics, and servers. And the most important part: it's launcher has no 'support' for native minecraft. And the one I'm going to base it one, has that support. And now comes the reason why I want to modify that launcher: it is overloaded with the theme of the server wherefore it was made. And I want to remove that theme. Like I wrote in the first post. And the reason that I'm not going to rebuild a launcher from scratch: my java is as bad. Just really bad. But you have to start somewhere. So let's get back to my question: how to get past the 'Could not find the main class file' error?

  10. #10
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,038
    Rep Power
    10

    Default Re: Could not find the main class error

    You can't just edit class files and expect things to work just fine, especially if you're inexperienced with Java. Edit the source and recompile. I don't understand why you think it's easier to do it by extracting the class files, editing them, and trying to put them back together.

    For anything more than that, you might consider contacting the developers directly.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  11. #11
    jasper580 is offline Member
    Join Date
    Mar 2012
    Posts
    7
    Rep Power
    0

    Default Re: Could not find the main class error

    For a simple thing: I'm inexperienced with java. I can't just edit a source. In that case, it's easier to just rebuild the jar from scratch. Because like I told: that source has totally NOTHING to do, with want I want to get. But I guess your right about contacting the developers. In the meantime: does anyone know a solution?

  12. #12
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,038
    Rep Power
    10

    Default Re: Could not find the main class error

    Editing the source will require you to rebuild the Jar from scratch. How does the source not have anything to do with what you want to accomplish?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  13. #13
    jasper580 is offline Member
    Join Date
    Mar 2012
    Posts
    7
    Rep Power
    0

    Default Re: Could not find the main class error

    What I actually meant was rebuilding the source from scratch. Because that source, is just a different Minecraft game. Like it told 4 posts above. And that launcher, has no option to choose between the Minecraft game, and the Spoutcraft game. And that launcher is included in the game, what will make me 'filter' it what will take a lot of time. That's why I'm basing it on something different, what has no source published yet. I only have to rename some strings in that way, and rebuild it
    Last edited by jasper580; 03-08-2012 at 07:05 PM.

Similar Threads

  1. Replies: 29
    Last Post: 02-02-2012, 09:23 PM
  2. Replies: 3
    Last Post: 12-09-2011, 04:51 AM
  3. Error: Could not find or load main class
    By ITSlave in forum New To Java
    Replies: 4
    Last Post: 09-15-2011, 10:47 AM
  4. runtime error 'could not find main class' ?
    By ruud00000 in forum Java Applets
    Replies: 5
    Last Post: 12-31-2010, 06:58 PM
  5. [SOLVED] Could not find the main class: error...
    By bobleny in forum New To Java
    Replies: 21
    Last Post: 03-02-2010, 11:53 AM

Tags for this Thread

Posting Permissions

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