Possible Duplicate:
Convert .c to .java

Is there any online free tool for C/C++ to Java?

I searched on the internet but couldnt find a converter C/C++ to Java. In adddition, how can I use header files in converting process to Java.

2

2 Answers

If the code cannot be easily understood, your best option may be to use JNI This allows you to call C code from Java without altering it. You are likely to need to write come bridge code to copy data from the Java world to the C world, but you shouldn't need to change the original C itself.


It is hard to be specific with such a broad question. What you can do is:

  • Turn headers into interfaces and classes.
  • Turn source class into java files.
  • Use the same object a method names where possible.
  • Use java's signed values where you currently have unsigned, with work arounds (sometimes none are required)
2

A tool like that would be extremely large and bloated. The best way to convert C/C++ to Java is by hand.

2