Closed kdaek21 closed 1 week ago
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.. However, since only the assembly is created, the remaining necessary files must be created or copied separately to ensure normal operation. (Except for special cases such as Spring Boot)
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.
I have the same problem,it donesn’t work
To statically convert for .NET Core, I found the following. Example) Static conversion for net8.0
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.
I have the same problem,it donesn’t work
I was adding information about net core, and you answered it again.. net core needs to be compiled properly with the -nostdlib option.
thanks
I have another problem,can you help me
I have another problem,can you help me
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, and Systme.Console.dll, System.Threading.dll, and System.Threading.Thread.dll were additionally required.
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
I have another problem,can you help me
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, and Systme.Console.dll, System.Threading.dll, and System.Threading.Thread.dll were additionally required.
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.