ikvmnet / ikvm

A Java Virtual Machine and Bytecode-to-IL Converter for .NET
Other
1.17k stars 110 forks source link

Internal Compiler Error: FileNotFoundException: netstandard (8.6.2.0) #405

Closed nico-csp closed 11 months ago

nico-csp commented 11 months ago

Symptom

FileNotFoundException occurred; tool asked to file a ticket.

IKVM Version and Package

I used the ZIP package

 https://github.com/ikvmnet/ikvm/releases/download/8.6.2/IKVM-8.6.2-tools-netcoreapp3.1-win7-x64.zip

The Task

I tried to convert a JAR to a DLL by calling ikvmc.

This was the call and output:

CMD> ikvmc -target:library -out:MyLib.dll -assembly:MyLib -version:6.4.2.4 MyLib-6.4.2.4.jar
IKVM.Tools.Importer (8.6.2+Branch.tags-8.6.2.Sha.854ec19f2c698bf3a9742f6f7eebdde4fc9166c3)
Copyright © 2023 Jeroen Frijters, Windward Studios, Jerome Haltom, Shad Storhaug

*** INTERNAL COMPILER ERROR ***

PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE

IKVM.Tools.Importer, Version=8.6.2.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58
(...current directory...)
3.1.32 64-bit

System.IO.FileNotFoundException: netstandard
   at IKVM.Reflection.Universe.Load(String refname, Module requestingModule, Boolean throwOnError) in C:\work\ikvm\src\IKVM.Reflection\Universe.cs:line 547
   at IKVM.Tools.Importer.AssemblyResolver.Init(Universe universe, Boolean nostdlib, IList`1 references, IList`1 userLibPaths) in C:\work\ikvm\src\IKVM.Tools.Importer\AssemblyResolver.cs:line 96
   at IKVM.Tools.Importer.IkvmImporterInternal.Compile(String[] args) in C:\work\ikvm\src\IKVM.Tools.Importer\IkvmImporterInternal.cs:line 179
   at IKVM.Tools.Importer.IkvmImporterInternal.Execute(String[] args) in C:\work\ikvm\src\IKVM.Tools.Importer\IkvmImporterInternal.cs:line 112

Question

Could there be a simple workaround for the time beeing?

wasabii commented 11 months ago

We recommend people simply trying to add a Java library to their .NET application use IkvmReference or MavenReference, as described in the README. The command line options to ikvmc are very long and complicated, and IkvmReference provides them automatically baesd on the build environment.

Otherwise, ikvmc needs a -reference argument for each of the ref assemblies that are part of the target framework; and a -runtime argument pointing to the version of IKVM.Runtime you want the generated assembly to bind to.

nico-csp commented 11 months ago

Thank you! Understood. I will try that instead then. The message "internal compiler error" sounded like a more general problem.

nico-csp commented 11 months ago

When adding the JAR via IkvmReference, it seems to work flawlessly.

So for me, the issue could be closed. Thanks for your support!

Or do you think, the issue should stay open, because "internal compiler error" requires additional treatment in the code?

wasabii commented 11 months ago

Our poor error messages already have bugs open.