0

Using java decompiler a .class file was converted to .java which needed some code change.

However how do I compile this java file?

Using jdk1.5 it doesn't compile this file similar to the original class file.

Which compiler do I need to use in this case?

1
  • 1
    That might depend on the original Java version and the decompiler. Note that not all decompilers can handle the newer features of Java correctly. Besides that, you might want to be more specific in how those files differ or what exactly doesn't work. Commented Mar 22, 2012 at 7:21

2 Answers 2

1

using IDE it would be far easier,

Install Netbeans, Create a mobile app project ,Copy your java file in source dir, Build the project and grab the .class file from target dir

Sign up to request clarification or add additional context in comments.

Comments

1

To compile for the J2ME platform, you need some specific tool. Last time I had to do this (4 years ago, may have changed), I needed the SUN J2ME SDK (now: Sun Wireless toolkit : http://www.oracle.com/technetwork/java/index-jsp-137162.html - ).

This SDK (which contained a J2ME emulator) allowed to do some modification to the .class files generated, some pre-check that included additionnal information in the .class files (preverification). Without them, the code wouldn't run (I tried to do the same thing as you do, with a legacy application).

Here is a link in SO which a question (and answer) about this subject: What does preverification of J2ME application mean?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.