Note that there are some explanatory texts on larger screens.

plurals
  1. POForce .java to .class compilation
    text
    copied!<p>I'm experiencing some problems with my understanding of the java compiler.</p> <p>If you know Minecraft you may know that there are many mods to the game, which are pieces of modified classes that are injected into the original .jar replacing the old (original) .class, the problem is that if you want to use 2 different mods that replace the same .class, this would be kinda impossible, unless you blend in the code of both of them and do some edition.</p> <p>Well, I got the 2 mods that uses the same .class and decompiled both of the classes (the decompilation were SUCCESSFUL), analyzed, modified and created a .java file that works for both mods at the same time. My problem now is that I have to recompile this .java into a .class file so I can inject into the minecraft .jar, but every time I try to compile it, I get a lot of errors, such as <code>class, interface, or enum expected</code> and <code>selection does not contain main type</code> those errors were expected, because the code mentions a lot of external classes and does not contain main type really.</p> <p>I'd like to know if any of you know anyway to kinda translate the .java to a .class binary file ignoring all the errors I've got due to what was mentioned before or if you have any other suggestion about how can I do it.</p> <p>PS: This code is not a full program, thats why I got those errors, it would work perfectly when inside the .jar, please don't answer that it's pointless compile this file alone.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload