mirror of https://github.com/kivy/pyjnius.git
detect JVM location on Mac using /usr/libexec/java_home
This commit is contained in:
parent
68a7d9b04e
commit
e6ee4fdba3
|
@ -2,7 +2,7 @@ include "config.pxi"
|
||||||
import os
|
import os
|
||||||
from shlex import split
|
from shlex import split
|
||||||
from subprocess import check_output
|
from subprocess import check_output
|
||||||
from os.path import dirname, join
|
from os.path import dirname, join, exists
|
||||||
from os import readlink
|
from os import readlink
|
||||||
from sys import platform
|
from sys import platform
|
||||||
from .env import get_jnius_lib_location
|
from .env import get_jnius_lib_location
|
||||||
|
@ -56,6 +56,14 @@ cdef find_java_home():
|
||||||
except OSError:
|
except OSError:
|
||||||
break
|
break
|
||||||
return dirname(dirname(java)).decode('utf8')
|
return dirname(dirname(java)).decode('utf8')
|
||||||
|
|
||||||
|
if platform in ('darwin'):
|
||||||
|
#its a mac
|
||||||
|
if not exists('/usr/libexec/java_home'):
|
||||||
|
return
|
||||||
|
java = check_output('/usr/libexec/java_home').strip().decode('utf8')
|
||||||
|
return java
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cdef void create_jnienv() except *:
|
cdef void create_jnienv() except *:
|
||||||
|
|
Loading…
Reference in New Issue