Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find a Java to C# converter? [closed]

Tags:

java

c#

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?

like image 842
CSharpDevLondon Avatar asked Jan 14 '09 13:01

CSharpDevLondon


People also ask

Can you convert Java to C?

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.

Is there any link between C and Java?

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.

Is Java built on C?

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.


1 Answers

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.

like image 73
Jon Skeet Avatar answered Oct 09 '22 02:10

Jon Skeet