-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
imvmc.exe errors when compiling a basic jar file #110
Comments
This seems like an odd version to be using: 8.2.0-prerelease.392. 8.2.0 was released almost two weeks ago. Also, ikvmc will require that all required dependent DLL files are specified using -reference. That includes IKVM.Java from the bin package. And it requires -runtime be specified to to point to IKVM.Runtime. This is all much easier using IKVM.Maven.Sdk or IkvmReference in your build files, however. |
stale |
Still having this problem with the latest release. |
Post the command line and error message. |
Hey @wasabii I am trying to convert from the command line.
The jar is compiled with java 8. |
-r is for adding a reference to an assembly. I believe the input files have no argname. Yes, there is copious documentation on using IkvmReference on the Readme |
Hey @wasabii I am trying to convert from the command line. IKVM.Tools.Importer (8.7.3+Branch.tags-8.7.3.Sha.93a12b1dfa8e91459d36916cbdb2425e68643b03) Error: core library not found *** INTERNAL COMPILER ERROR *** PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE IKVM.Tools.Importer, Version=8.7.3.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58 System.IO.FileNotFoundException: System.Runtime The System.Runtime.dll is already present in IKVM-8.7.0-bin-net6.0\ikvmc\net6.0\win-x64 folder Is there any other way to convert the jar to .dll seamlessly. |
Hey Did you get the solution for the issue you were facing |
-r is for referencing the dependent .NET assemblies. You've used it to reference a JAR file. So it is breaking saying it isn't a PE image with metadata (a .NET assembly). We strongly recommend using IkvmReference or MavenReference. |
Hey @wasabii I am trying to convert from the command line. IKVM.Tools.Importer (8.7.3+Branch.tags-8.7.3.Sha.93a12b1dfa8e91459d36916cbdb2425e68643b03) Error: core library not found *** INTERNAL COMPILER ERROR *** PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE IKVM.Tools.Importer, Version=8.7.3.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58 System.IO.FileNotFoundException: System.Runtime The System.Runtime.dll is already present in IKVM-8.7.0-bin-net6.0\ikvmc\net6.0\win-x64 folder Is there any other way to convert the jar to .dll seamlessly. |
As I said, you should favor using IkvmReference or MavenReference. Else, you will need to add a -r argument for every assembly that forms the reference assembly pack for runtime you are intending to target. For .NET Framework this will be all of the reference assemblies installed by the various targeting packs. For Core, this will be all of the assemblies for the Microsoft.NETCore.App.Ref pack of the specific version of .NET Core you want to target. |
Hi Jerome Haltom,
Thanks for your reply .
I shall try using IkvmReference or MavenReference.
I just tried using the -r argument and execute the below command ,
but still it was giving me the same error.
I was expecting an error but it should have referred to some other assembly from the Microsoft.NETCore.App\6.0.25 folder instead of System.Runtime.dll
Am I doing something wrong , can you verify the below command.
Command -
ikvmc -reference:"C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.25\System.Runtime.dll" -out:hha-pricer-application-1.12.0.dll hha-pricer-application-1.12.0.jar
Erorr -
Error: core library not found
*** INTERNAL COMPILER ERROR ***
PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE
IKVM.Tools.Importer, Version=8.7.3.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58
C:\Users\Lenovo\Downloads\IKVM-8.7.3-bin-net6.0\ikvmc\net6.0\win-x64\
6.0.25 64-bit
System.IO.FileNotFoundException: System.Runtime
at IKVM.Reflection.Universe.Load(String refname, Module requestingModule, Boolean throwOnError) in /_/src/IKVM.Reflection/Universe.cs:line 564
at IKVM.Tools.Importer.AssemblyResolver.Init(Universe universe, Boolean nostdlib, IList`1 references, IList`1 userLibPaths) in /_/src/IKVM.Tools.Importer/AssemblyResolver.cs:line 84
at IKVM.Tools.Importer.IkvmImporterInternal.Compile(String[] args) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 181
at IKVM.Tools.Importer.IkvmImporterInternal.Execute(String[] args) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 111
Appreciate your help!
Thanks,
varratna
…________________________________
From: Jerome Haltom ***@***.***>
Sent: Tuesday, January 9, 2024 10:08 PM
To: ikvmnet/ikvm ***@***.***>
Cc: varratna ***@***.***>; Mention ***@***.***>
Subject: Re: [ikvmnet/ikvm] imvmc.exe errors when compiling a basic jar file (Issue #110)
As I said, you should favor using IkvmReference or MavenReference.
Else, you will need to add a -r argument for every assembly that forms the reference assembly pack for runtime you are intending to target. For .NET Framework this will be all of the reference assemblies installed by the various targeting packs.
For Core, this will be all of the assemblies for the Microsoft.NETCore.App.Ref pack of the specific version of .NET Core you want to target.
—
Reply to this email directly, view it on GitHub<#110 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AO6IM3X7O5FEUOADY7BD5QLYNVXB7AVCNFSM53SS2JNKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBYGMZTSNBZHA4A>.
You are receiving this because you were mentioned.
|
Hi
I am able to convert the java.jar file to .dll file
I am trying to access the main class and create and object to call the respective methods
but I am not able to get the namespace of the main class in the .dll
It did not give any error or warning . I used the IKVM reference method.
eg hha-pricer-application-1.12.0.jar\gov\cms\fiss\pricers\hha - my main class in java.jar - this namespace and class not accessible in .net (.dll)
other folder structure
hha-pricer-application-1.12.0.jar\com - these namespace and classes are accessible
hha-pricer-application-1.12.0.jar\nonapi\io\github\classgraph - these namespace and classes are accessible
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IKVM" Version="8.7.3" />
<PackageReference Include="IKVM.Image.JDK" Version="8.7.3" />
<PackageReference Include="IKVM.Image.JRE" Version="8.7.3" />
</ItemGroup>
<ItemGroup>
<IkvmReference Include=".\JarFile\hha-pricer-application-1.12.0.jar" />
</ItemGroup>
</Project>
can you help me out in this
Thanks,
varratna
…________________________________
From: Jerome Haltom ***@***.***>
Sent: Tuesday, January 9, 2024 10:08 PM
To: ikvmnet/ikvm ***@***.***>
Cc: varratna ***@***.***>; Mention ***@***.***>
Subject: Re: [ikvmnet/ikvm] imvmc.exe errors when compiling a basic jar file (Issue #110)
As I said, you should favor using IkvmReference or MavenReference.
Else, you will need to add a -r argument for every assembly that forms the reference assembly pack for runtime you are intending to target. For .NET Framework this will be all of the reference assemblies installed by the various targeting packs.
For Core, this will be all of the assemblies for the Microsoft.NETCore.App.Ref pack of the specific version of .NET Core you want to target.
—
Reply to this email directly, view it on GitHub<#110 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AO6IM3X7O5FEUOADY7BD5QLYNVXB7AVCNFSM53SS2JNKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBYGMZTSNBZHA4A>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I am having problems getting ikvmc.exe to compile a rudimentary jar file. Here is the command line and result.
I created the jar file from a basic hello world.
Jar creation build against openjdk 11.0.12
I am pretty much ignorant of java development in general so potentially I am missing something basic. I do know .NET pretty well and fostered a library that used IKVM for exposing a java library on dotnet. I am attempting to get this working on dotnet core but the ikvmc.exe step fails with a similar error so I tried this basic example to debug.
The text was updated successfully, but these errors were encountered: