3

I am writing a silverlight application using c#. For the project I need to be able to compile and download a program to an external drive. I have the code to do this however it is written in Java.

The code is extensive and would take an excessive amount of time to translate all of it into c#. Is there an alternate way to translate the code into c# or is there a way to run java code within a c# project?

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445

3 Answers3

4

You could always compile it as an executable and run it with Process.Start.

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
1

You can use IKVM.net to convert the jar to a dll

jjchiw
  • 4,375
  • 1
  • 29
  • 30
  • There's no need to convert the jar file to a dll since C# can simply execute it by calling `java -jar yourJarFile`. – Hovercraft Full Of Eels Jun 19 '12 at 15:15
  • @HovercraftFUllOfEels um, unless of course the developer of the C# application wants to embed java code without having to rely on the user having java or forcing the user to install it, or the C# developer wants to be able access java types in code, or the Java developer C# types, so on and so forth. Should actually look at the project...... –  Oct 21 '14 at 15:51
0

In google you can find a online service for it or change same code witch doesn't work

Gorets
  • 2,434
  • 5
  • 27
  • 45