Corrupt jar file

This will happen when you doubleclick a JAR file in Windows explorer, but the JAR is by itself actually not an executable JAR. A real executable JAR should have at least a class with a main() method and have it referenced in MANIFEST.MF. In Eclispe, you need to export the project as Runnable JAR file instead of as JAR file to get a real … Read more

How can I edit a .jar file?

So I have a jar file with one .class file on it. I just need to change some words in the file. What program should I use? I want this to work for my phone.

What causes java.lang.IncompatibleClassChangeError?

This means that you have made some incompatible binary changes to the library without recompiling the client code. Java Language Specification §13 details all such changes, most prominently, changing non-static non-private fields/methods to be static or vice versa. Recompile the client code against the new library, and you should be good to go. UPDATE: If you publish a public library, … Read more

Eclipse “Error: Could not find or load main class”

In your classpath you’re using an absolute path but you’ve moved the project onto a new machine with quite possibly a different file structure. In your classpath you should therefore (and probably in general if you’re gonna bundle JARS with your project), use relative pathing: In your .classpath change to

How to decompile a whole Jar file?

2009: JavaDecompiler can do a good job with a jar: since 0.2.5, All files, in JAR files, are displayed. See also the question “How do I “decompile” Java class files?”. The JD-Eclipse doesn’t seem to have changed since late 2009 though (see Changes).So its integration with latest Eclipse (3.8, 4.2+) might be problematic. JD-Core is actively maintained. Both are … Read more

How do I create executable Java program?

You can use the jar tool bundled with the SDK and create an executable version of the program. This is how it’s done. I’m posting the results from my command prompt because it’s easier, but the same should apply when using JCreator. First create your program: Very simple, just displays a window with “Hello World” Then compile … Read more