IKVM - Unable to convert a jar to dll

I am using IKVM to convert a jar file to a dll, so that I can use it with C# to test the Java application. I don't have the original Java source code or the class files. Here is what I am doing and the error I get:

ikvmc myApplication.jar

Note IKVMC0002: output file is "asapi.dll"
Warning IKVMC0100: class "org.apache.log4j.Logger" not found
Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in "com.myApp.authenticateUser(LNote IKVMC0002: output file is "asapi.dll"
Warning IKVMC0100: class "org.apache.log4j.Logger" not found
Warning IKVMC0111: emitted java.lang.NoClassDefFoundError in vices.AsApi.authenticateWithArtifact(Ljava.lang.String;Lcom.myApp.AppApi)....

Any ideas? This jar file doesn't contain a main method...

Upvotes: 1

Views: 1702

Answers (1)

carlspring
carlspring

Reputation: 32567

I believe you need something more along the lines of:

/usr/bin/mono \
 /path/to/ikvm-0.42.0.6/bin/ikvmc.exe \
 /path/to/project/target/project-1.2.3.4.jar \
 -out:/path/to/project/target/project-1.2.3.4.dll \
 -keyfile:/path/to/project/target/private-key.snk \
 -assembly:project-1.2.3.4 \
 -fileversion:1.2.3.4 \
 -version:1.2.3.4

If your application depends on third-party jars, you might need to add them to the jar, using shading (not good practice at all).

Upvotes: 1

Related Questions