-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is command line compilation via ikvmc.exe no longer supported when statically converting Java bytecode to CIL? #613
Comments
It is. But there are a lot of options you need to add. -reference to the ref assemblies of the runtime version you want to bind to. |
I found the default parameters for net472 version. If you do it like below, the conversion will work.. ikvmc -r:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll" -r:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.dll" -runtime:"D:\Java\ikvm-jre8-net472\bin\IKVM.Runtime.dll" [classOrjar1] ... [classOrJarN]
|
Those are possible paths. But probably not the ones you want. When building you probably want to bind against the reference assemblies from the appropriate target framework version. |
To statically convert for .NET Core, I found the following. ikvmc -target:library -r:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.10\ref\net8.0\System.Runtime.dll" -runtime:"D:\Java\ikvm-jre8-net8.0\bin\IKVM.Runtime.dll" -nostdlib -main:[Class name including the package containing the main function] [classOrjar1] ... [classOrJarN]
I ended up finding what I wanted myself, so I'll close this issue. |
thanks |
net core requires more references than net472. Below is the compilation syntax that I tested with Tomcat. When compiling Tomcat... System.Runtime.dll is required by default, ikvmc -target:library -r:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.10\ref\net8.0\System.Runtime.dll" -r:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.10\ref\net8.0\System.Console.dll" -r:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.10\ref\net8.0\System.Threading.dll" -r:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.10\ref\net8.0\System.Threading.Thread.dll" -runtime:"D:\Java\ikvm-jre8-net8.0\bin\IKVM.Runtime.dll" -recurse:"./lib" -nostdlib -main:"org.apache.catalina.startup.Bootstrap" bootstrap.jar tomcat-juli.jar |
oh,i understand,thanks very much~! |
I checked the contents of the comment that said to refer to 'https://github.com/orgs/ikvmnet/discussions/463' in the #612 I registered,
I saw the distinction IKVM.Runtime.Launcher.Run (string main, bool jar, string [] args, string rarg, IDictionary<string, string>properties), and in the comment there was something about Launcher, so I tried static conversion using ikvmc on the command line to see if the Spring Boot launcher part would be converted to IKVM.Runtime.Launcher.Run when using ikvmc for static conversion, but
Core library not found. Make sure the appropriate reference assemblies for the target environment are included. It only gives an error and does not convert. (It is the same even if I make a simple sample)
I looked it up and found that a similar issue was registered before, so I checked and it said to use ikvmReference. When I checked using ikvmReference, it seems to be a method of using jar files as libraries for .NET projects using Visual Studio.
Is there no longer a way to convert a class that contains a (Java) main function or a Java jar file that contains this class into a CIL exe file using ikvmc?
The IKVM tools used are IKVM-8.10.3-tools-net472-win-x64.
The text was updated successfully, but these errors were encountered: