ikvmnet / ikvm

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

IKVMC5031: Bootstrap classes missing and core assembly not found #317

Closed nick92 closed 1 year ago

nick92 commented 1 year ago

Getting the below error trying to compile JAR file using ikvmc (8.4.5)

fatal error IKVMC5031: Bootstrap classes missing and core assembly not found

full output is:


ikvmc -target:library -nostdlib -r:./refs/*.dll Compile.jar
ikvmc (8.4.5+Branch.main.Sha.548430396151a2e5cb51fb319e15524bd601ace5)
Copyright © 2023 Jeroen Frijters, Windward Studios, Jerome Haltom, Shad Storhaug

warning IKVMC0127: Assembly ".\refs\netstandard.dll" is ignored as previously loaded assembly "C:\ikvm-tools-8.4.5-netcore3.1\netstandard.dll" has the same identity "netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"
note IKVMC0002: Output file is "Compile.dll"
fatal error IKVMC5031: Bootstrap classes missing and core assembly not found

The jar worked on previous version of IKVM (8.1.7195.0), is there something additional that this version requires to be able to compile?

wasabii commented 1 year ago

A number of things have become more complicated since the introduction of Core support. ikvmc now needs every assembly that you might need to reference to convert a specific jar specified as a -reference. This is because it can no longer just be hard coded to something like 'mscorlib.dll' for everything. There's dozens of different versions of .NET Core 3.1, for instance, each with dozens and dozens of different assemblies (mscorlib was split apart into many assemblies). And now 'ref' assemblies as opposed to implementation assemblies.

As well as the -runtime option to point to the version of IKVM.Runtime.dll you want to use.

So command lines for compiling JARs are simply more complex. Lots more references. Lots more options.

That said, the recommend way to go about using IKVM is just to add IkvmReferences or MavenReferences to your MSBuild project. That takes care of all of the magic. Documented in the README file.

nick92 commented 1 year ago

Ok thanks for the information

Are you able to explain specifically what this error is telling me? is it an issue within the JAR file? and if so what specifically can I do to fix this

I've added in the -runtime parameter but still get the same error

wasabii commented 1 year ago

There's no reference to IKVM.Java.

nick92 commented 1 year ago

Prefect, adding that into my refs directory resolved that issue for me