JVMNotFoundError: Can't find the Java Virtual Machine

74 views
Skip to first unread message

A mohammadkhani

unread,
Mar 20, 2019, 9:04:18 AM3/20/19
to python-weka-wrapper

I want to use Weka in my python code, so I install java-wrapper python(2.7.16 ) according to https://fracpete.github.io/python-weka-wrapper/install.html and my java version is:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Also, I added the JDK path to user variable PATH according to https://troubleshooter.xyz/wiki/fix-java-virtual-machine-jvm-not-found-error/

but it raise error:

   >>>import os
   >>>import traceback
   >>>import weka.core.jvm as jvm
   Traceback (most recent call last):
    File "<pyshell#2>", line 1, in <module>
    import weka.core.jvm as jvm
     File "C:\Python27\lib\site-packages\weka\core\jvm.py", line 17, in <module>
    import javabridge
     File "C:\Python27\lib\site-packages\javabridge\__init__.py", line 38, in <module>
    from .jutil import start_vm, kill_vm, vm, activate_awt, deactivate_awt
    File "C:\Python27\lib\site-packages\javabridge\jutil.py", line 151, in <module>
    os.pathsep + os.path.join(find_javahome(), "bin")
    File "C:\Python27\lib\site-packages\javabridge\jutil.py", line 139, in _find_jvm
    raise JVMNotFoundError()
JVMNotFoundError: Can't find the Java Virtual Machine

I am using Windows 10, Does it may be related to my Windows?
for both user variable and system variable --> JAVA_HOME=C:\Program Files\Java\jdk1.8.0_181\bin and JAVA_HOME= C:\Program Files\Java\jre1.8.0_181\bin
PATH=C:\Program Files\Java\jdk1.8.0_181\bin and PATH=C:\Program Files\Java\jre1.8.0_181\bin

Peter Reutemann

unread,
Mar 20, 2019, 12:23:10 PM3/20/19
to python-weka-wrapper
Remove the "bin" from your JAVA_HOME variable. Only use the path to the JDK.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/

--
You received this message because you are subscribed to the Google Groups "python-weka-wrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-weka-wra...@googlegroups.com.
To post to this group, send email to python-we...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python-weka-wrapper/44f34847-023e-4cd8-97f5-75ee1b823382%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ayush Agrawal

unread,
Mar 27, 2019, 12:33:31 AM3/27/19
to python-weka-wrapper
rename your javabridge-1.08 with only javabridge in python-lib-sitepackages folder. This will definitely works for you.

Peter Reutemann

unread,
Mar 27, 2019, 1:05:54 AM3/27/19
to python-weka-wrapper
A solution was posted on stackoverflow:


Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
On Thu, Mar 21, 2019, 2:04 AM A mohammadkhani <amohamma...@gmail.com wrote:
--
Reply all
Reply to author
Forward
0 new messages