#62 getDefaultJVMPath doesn't gracefully handle missing JAVA_HOM

Version 0.5
open
Steve Menard
5
2009-06-18
2009-06-18
Garrett Smith
No

The traceback is below.

I think this function should return None if it can't get the default path. It's then up to the caller to deal with error handling.

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/jpype/_core.py", line 96, in getDefaultJVMPath
return _linux.getDefaultJVMPath()
File "/usr/lib/python2.5/site-packages/jpype/_linux.py", line 36, in getDefaultJVMPath
jvm = _getJVMFromJavaHome()
File "/usr/lib/python2.5/site-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'

Discussion

  • Garrett Smith
    Garrett Smith
    2009-06-18

    Sorry -- I just noticed this is a dup of 2799530