ikvmnet / ikvm

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

Error: core library not found #457

Closed ruben-monsalve closed 11 months ago

ruben-monsalve commented 11 months ago

Hi, i have download tools for net472 in windows (x64) package, unzipped and create a simple jar file with the following code (World.java):

package com.demo;

public class World {
    private String name;

    public World() {
        this.name = "World";
    }

    public World(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Hello " + name;
    }
}

I had run the following secuence of commands in cmd console:

C:\ikvm>javac -version javac 1.8.0_391

C:\ikvm>java -version java version "1.8.0_391" Java(TM) SE Runtime Environment (build 1.8.0_391-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.391-b13, mixed mode)

C:\ikvm>javac World.java

C:\ikvm>jar cvf World.jar World.class manifiesto agregado agregando: World.class(entrada = 562) (salida = 339)(desinflado 39%)

C:\ikvm>ikvmc -target:library World.jar IKVM.Tools.Importer (8.7.1+Branch.tags-8.7.1.Sha.e4ff2051f79fc0849223e953f257ca37e2a0f854) Copyright © 2023 Jeroen Frijters, Windward Studios, Jerome Haltom, Shad Storhaug

Error: core library not found note IKVMC0002: Output file is "World.dll" warning IKVMC0135: Unable to compile "World" (wrong name: "com.demo.World")

Anyway, a World.dll file is generated but it doesn't work, it doesn't cotains the public methods.

Im also trying to convert to dll another library, but with the following errors:

C:\ikvm>ikvmc -target:library apiclient-3.0.6-all.jar IKVM.Tools.Importer (8.7.1+Branch.tags-8.7.1.Sha.e4ff2051f79fc0849223e953f257ca37e2a0f854) Copyright © 2023 Jeroen Frijters, Windward Studios, Jerome Haltom, Shad Storhaug

Error: core library not found note IKVMC0002: Output file is "apiclient-3.0.6-all.dll" warning IKVMC0101: Unable to compile class "META-INF.versions.11.module-info" (class format error "53.0") warning IKVMC0109: Skipping class: "javax.annotation.PreDestroy" (class is already available in referenced assembly "IKVM.Java, Version=8.7.1.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58") warning IKVMC0101: Unable to compile class "META-INF.versions.9.org.apache.logging.log4j.util.Base64Util" (class format error "53.0") warning IKVMC0101: Unable to compile class "META-INF.versions.9.org.apache.logging.log4j.util.internal.DefaultObjectInputFilter" (class format error "53.0") warning IKVMC0101: Unable to compile class "META-INF.versions.9.org.apache.logging.log4j.util.StackLocator" (class format error "53.0") warning IKVMC0101: Unable to compile class "META-INF.versions.9.module-info" (class format error "53.0") warning IKVMC0101: Unable to compile class "META-INF.versions.9.org.apache.logging.log4j.util.ProcessIdUtil" (class format error "53.0")

INTERNAL COMPILER ERROR

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

IKVM.Tools.Importer, Version=8.7.1.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ 4.0.30319.42000 64-bit

System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto. en IKVM.Runtime.AttributeHelper.GetEditorBrowsableNever() en //src/IKVM.Runtime/AttributeHelper.cs:línea 402 en IKVM.Runtime.RuntimeByteCodeJavaType.JavaTypeImpl.AnnotationBuilder.Link() en //src/IKVM.Runtime/RuntimeByteCodeJavaType.JavaTypeImpl.cs:línea 1554 en IKVM.Runtime.RuntimeByteCodeJavaType.JavaTypeImpl.AnnotationBuilder.MakeCustomAttributeBuilder(RuntimeClassLoader loader, Object annotation) en //src/IKVM.Runtime/RuntimeByteCodeJavaType.JavaTypeImpl.cs:línea 1844 en IKVM.Runtime.RuntimeByteCodeJavaType.JavaTypeImpl.AnnotationBuilder.Apply(RuntimeClassLoader loader, TypeBuilder tb, Object annotation) en //src/IKVM.Runtime/RuntimeByteCodeJavaType.JavaTypeImpl.cs:línea 1853 en IKVM.Runtime.RuntimeByteCodeJavaType.FinishContext.FinishImpl() en //src/IKVM.Runtime/RuntimeByteCodeJavaType.FinishContext.cs:línea 728 en IKVM.Runtime.RuntimeByteCodeJavaType.JavaTypeImpl.FinishCore() en //src/IKVM.Runtime/RuntimeByteCodeJavaType.JavaTypeImpl.cs:línea 1285 en IKVM.Runtime.RuntimeByteCodeJavaType.JavaTypeImpl.Finish() en //src/IKVM.Runtime/RuntimeByteCodeJavaType.JavaTypeImpl.cs:línea 1206 en IKVM.Tools.Importer.RuntimeImportByteCodeJavaType.Finish() en //src/IKVM.Tools.Importer/RuntimeImportByteCodeJavaType.cs:línea 116 en IKVM.Runtime.DynamicClassLoader.FinishAll() en //src/IKVM.Runtime/DynamicClassLoader.cs:línea 412 en IKVM.Tools.Importer.CompilerClassLoader.Compile(RuntimeContext context, StaticCompiler compiler, String runtimeAssembly, List`1 optionsList) en //src/IKVM.Tools.Importer/CompilerClassLoader.cs:línea 2547 en IKVM.Tools.Importer.IkvmImporterInternal.Compile(String[] args) en //src/IKVM.Tools.Importer/IkvmImporterInternal.cs:línea 196 en IKVM.Tools.Importer.IkvmImporterInternal.Execute(String[] args) en //src/IKVM.Tools.Importer/IkvmImporterInternal.cs:línea 111

I can't understand what im doing bad. Sorry for my English.

Thanks for your support and help

Regads. Ruben M.

wasabii commented 11 months ago

https://github.com/ikvmnet/ikvm/issues/405

wasabii commented 11 months ago

Closing, duplicate.