jpype.getDefaultJVMPath() fails

Bug #1023806 reported by Gyorgy Orosz
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-jpype (Debian)
Fix Released
Unknown
python-jpype (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Using Ubuntu 12.04 and having the default installation of Python 2.7.3, the call of 'jpype.getDefaultJVMPath()' fails:

~$ python
Python 2.7.3 (default, Apr 20 2012, 22:39:59)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jpype
>>> jpype.getDefaultJVMPath()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/jpype/_core.py", line 96, in getDefaultJVMPath
    return _linux.getDefaultJVMPath()
  File "/usr/lib/python2.7/dist-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
    jvm = _getJVMFromJavaHome()
  File "/usr/lib/python2.7/dist-packages/jpype/_linux.py", line 55, in _getJVMFromJavaHome
    if os.path.exists(java_home+"/bin/javac") :
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
>>>

Revision history for this message
David Gilman (davidgilman1) wrote :

I've opened a companion bug with Debian as the problem exists there too. ( http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683048 )

As a workaround you can set the JAVA_HOME enviroment variable. Assuming that the JVM was installed in /usr/lib/jvm/java-7-openjdk-amd64/ you run python like this:

JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 python my_script.py

and jpype will work just fine.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-jpype (Ubuntu):
status: New → Confirmed
Changed in python-jpype (Debian):
status: Unknown → Confirmed
Changed in python-jpype (Debian):
status: Confirmed → Fix Released
Revision history for this message
Logan Rosen (logan) wrote :

This bug was fixed in the package python-jpype - 0.5.4.2-3

---------------
python-jpype (0.5.4.2-3) unstable; urgency=low

  [ Jakub Wilk ]
  * Use canonical URIs for Vcs-* fields.

  [ TANIGUCHI Takaki ]
  * Bump Standards Version to 3.9.4 (with no changes).
  * debian/patches/default_jvm_path: Set default JVM path. (Closes: #683048)
  * debian/control: B-D depends on only default-jdk. (Closes: #684278)

 -- TANIGUCHI Takaki <email address hidden> Wed, 15 May 2013 13:30:55 +0900

Changed in python-jpype (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.