2

I am currently using Python3, java8, jpype 0.6.3 version on windows10. jpype.getDefaultJVMPath() fails with an error :

raise JVMNotFoundException("No JVM shared library file ({0}) "
jpype._jvmfinder.JVMNotFoundException: No JVM shared library file (jvm.dll) found. Try setting up the JAVA_HOME environment variable properly.

My JAVA_HOME points to C:\Program Files (x86)\Java\jdk1.8.0_241

If I try starting JVM directly by passing the jvm.dll path("C:\Program Files (x86)\Java\jdk1.8.0_241\jre\bin\client\jvm.dll) python program crashes. I have already given executable permission to .dll file

Could anyone please help me fix this issue for the above system specifications

PiRocks
  • 1,708
  • 2
  • 18
  • 29
Ornella
  • 21
  • 1
  • 3

3 Answers3

2

It is possible that your JVM architecture (32 bit) does not match your Python (64 bit). This would cause the symptoms you are describing.

Karl Nelson
  • 336
  • 2
  • 3
  • How do I check that the JVM and Python match? – struggleBus Nov 11 '20 at 19:39
  • There are detailed instructions of how to debug this issue under project/debug directory in the jpype repo. Unfortunately the full instructions depend on the type of machine and are rather involved so I can't post them all here. – Karl Nelson Nov 26 '20 at 23:44
0

It turns out that the shared code I was using required a specific version of one of the drivers. I still don't understand it all enough to explain why that was but with the older driver version (from a colleague) everything works!

struggleBus
  • 365
  • 2
  • 5
  • 20
0
from jpype import *
startJVM("/home/user_name/Downloads/ideaIC-2022.2.3/idea-IC- 222.4345.14/jbr/lib/server/libjvm.so", "-ea")

java.lang.System.out.println("hello world")
shutdownJVM()

This works for me set the path manually

startJVM("/home/user_name/Downloads/ideaIC-2022.2.3/idea-IC- 222.4345.14/jbr/lib/server/libjvm.so", "-ea")

If this path is not correct for you Search for this file libjvm.so inside partition computer on linux Then copy the file path

ayman2011a
  • 13
  • 1
  • 4