I needed to convert a Java 1.5se app to C# 2.0.
Does anyone know of a tool (preferably free/open source) to do this?
Yes, there's a Java to C source converter: a human programmer. (Reliability may be an issue, though.) If you really want to compile Java to C, you might try compiling Java to machine code with GCJ, then disassembling the machine code, then (somehow?) converting the assembly code to C.
C is a middle-level language as it binds the bridges between machine-level and high-level languages. Java is a high-level language as the translation of Java code takes place into machine language, using a compiler or interpreter. C is only compiled and not interpreted. Java is both compiled and interpreted.
The very first Java compiler was developed by Sun Microsystems and was written in C using some libraries from C++. Today, the Java compiler is written in Java, while the JRE is written in C.
Even if there is such a tool, I'd highly recommend you to do the conversion by hand. Automatic converters will often faithfully reproduce the code, but ignore idioms - because they'd be really, really hard to get right.
Furthermore, the differences between generics in .NET and Java could lead to some very different decisions in the two codebases.
Really, you'll be better off doing it by hand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With