Skip to content
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

Fix jvm loading on windows #713

Open
radekdoulik opened this issue Sep 11, 2020 · 0 comments
Open

Fix jvm loading on windows #713

radekdoulik opened this issue Sep 11, 2020 · 0 comments
Labels
bug Component does not function as intended java-interop Runtime bridge between .NET and Java

Comments

@radekdoulik
Copy link
Member

Currently jvm creation/loading with Java.Interop.JreRuntime.CreateJreVM doesn't work on Windows.

error JM4003: jnimarshalmethod-gen: Unable to create Java VM
System.Exception: Could not load JVM path `C:\Users\rodo\android-toolchain\jdk-1.8\jre\bin\server\jvm.dll`: The specified module could not be found.
 (-1002)!
   at Java.Interop.JreRuntime.CreateJreVM(JreRuntimeOptions builder) in C:\Users\rodo\git\java.interop\src\Java.Runtime.Environment\Java.Interop\JreRuntime.cs:line 101
   at Java.Interop.JreRuntime..ctor(JreRuntimeOptions builder) in C:\Users\rodo\git\java.interop\src\Java.Runtime.Environment\Java.Interop\JreRuntime.cs:line 138
   at Java.Interop.JreRuntimeOptions.CreateJreVM() in C:\Users\rodo\git\java.interop\src\Java.Runtime.Environment\Java.Interop\JreRuntime.cs:line 74
   at Xamarin.Android.Tools.JniMarshalMethodGenerator.App.CreateJavaVM(String jvmDllPath) in C:\Users\rodo\git\java.interop\tools\jnimarshalmethod-gen\App.cs:line 220
ls C:\Users\rodo\android-toolchain\jdk-1.8\jre\bin\server\jvm.dll


    Directory: C:\Users\rodo\android-toolchain\jdk-1.8\jre\bin\server

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---            3/6/2019 11:39 AM        8501256 jvm.dll

Dependencies:

dumpbin.exe /dependents android-toolchain\jdk-1.8\jre\bin\server\jvm.dll
Microsoft (R) COFF/PE Dumper Version 14.27.29110.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file android-toolchain\jdk-1.8\jre\bin\server\jvm.dll

File Type: DLL

  Image has the following dependencies:

    KERNEL32.dll
    USER32.dll
    ADVAPI32.dll
    WSOCK32.dll
    WINMM.dll
    VERSION.dll
    PSAPI.DLL
    MSVCR100.dll

  Summary

       72000 .data
       45000 .pdata
      1B2000 .rdata
       32000 .reloc
        1000 .rsrc
      5A9000 .text

Might be related to 08ff4db

So far I think that some of the jvm.dll dependencies are not loaded. Need to find a way to debug the dll loading process on Windows.

@radekdoulik radekdoulik added the java-interop Runtime bridge between .NET and Java label Sep 11, 2020
@radekdoulik radekdoulik self-assigned this Sep 11, 2020
@jpobst jpobst added the bug Component does not function as intended label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component does not function as intended java-interop Runtime bridge between .NET and Java
Projects
None yet
Development

No branches or pull requests

2 participants