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

Error occurred during initialization of VM #47

Open
clucian-mwb opened this issue Nov 26, 2024 · 5 comments
Open

Error occurred during initialization of VM #47

clucian-mwb opened this issue Nov 26, 2024 · 5 comments

Comments

@clucian-mwb
Copy link

I am trying to run ./pyhidraw, however it returns the following error.

Error occurred during initialization of VM
Could not find agent library instrument on the library path, with error: Can't find dependent libraries
Module java.instrument may be missing from runtime image.

Is it an issue with JDK? My java version is "21.0.5" 2024-10-15 LTS. Thx in advance

@astrelsky
Copy link

What JDK do you have? There is a similar issue here jpype-project/jpype#1242

However, Ghidra already requires the full JDK so this shouldn't be an issue. I did quite a bit of testing with jpype, Ghidra + PyGhidra before jpype 1.51 went out to ensure it wouldn't break PyGhidra. I have tested up to JDK 23 without issue.

@clucian-mwb
Copy link
Author

clucian-mwb commented Nov 27, 2024

You found the problem, jpype is causing this. I was able to reproduce it exactly as mentioned in that issue

Python 3.11.9
>>> import jpype
>>> jpype.getDefaultJVMPath()
'C:\\Program Files\\Java\\jdk-21\\bin\\server\\jvm.dll'
>>> jpype.startJVM()
Error occurred during initialization of VM
Could not find agent library instrument on the library path, with error: Can't find dependent libraries
Module java.instrument may be missing from runtime image.

The dll exists at that precise path, but returns the error anyway :(

I tried both with JDK 23 and JDK 21 at the newest versions and at two older ones as well (21.0.1 and 23.0.1).

@astrelsky
Copy link

astrelsky commented Nov 27, 2024

You found the problem, jpype is causing this. I was able to reproduce it exactly as mentioned in that issue

Python 3.11.9
>>> import jpype
>>> jpype.getDefaultJVMPath()
'C:\\Program Files\\Java\\jdk-21\\bin\\server\\jvm.dll'
>>> jpype.startJVM()
Error occurred during initialization of VM
Could not find agent library instrument on the library path, with error: Can't find dependent libraries
Module java.instrument may be missing from runtime image.

The dll exists at that precise path, but returns the error anyway :(

I tried both with JDK 23 and JDK 21 at the newest versions and at two older ones as well (21.0.1 and 23.0.1).

What JDK do you have installed? Not the version, where did you get it?

I wrote a portion of the code in jpype that handles this which is why I want to know. There is no reason for a JDK to exclude this standard module since it's for profiling and debugging.

You should have a C:\\Program Files\\Java\\jdk-21\\jmods\\java.instrument.jmod file and C:\\Program Files\\Java\\jdk-21\\lib\\modules should be around 130MB

@ryanmkurtz
Copy link

@clucian-mwb Can you run java -version and provide the output?

@clucian-mwb
Copy link
Author

@astrelsky
I tried both from here and here.

Yes I have both of those files at that paths. java.instrument.jmod is around 50MB and modules around 130MB

@ryanmkurtz This is the version I have installed right now, I tried an older one as well. Ghidra works smoothly.

java version "21.0.2" 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.2+13-LTS-58, mixed mode, sharing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants