mirror of https://github.com/kivy/pyjnius.git
Fix libary location for Java >=9. Fix #304
This commit is contained in:
parent
5e19dbe425
commit
763fad6cb0
23
setup.py
23
setup.py
|
@ -119,6 +119,18 @@ elif PLATFORM == 'darwin':
|
||||||
)]
|
)]
|
||||||
else:
|
else:
|
||||||
LIB_LOCATION = 'jre/lib/server/libjvm.dylib'
|
LIB_LOCATION = 'jre/lib/server/libjvm.dylib'
|
||||||
|
|
||||||
|
if isinstance(JRE_HOME, bytes):
|
||||||
|
JAVA_HOME = dirname(JRE_HOME.decode())
|
||||||
|
else:
|
||||||
|
JAVA_HOME = dirname(JRE_HOME)
|
||||||
|
FULL_LIB_LOCATION = join(JAVA_HOME, LIB_LOCATION)
|
||||||
|
|
||||||
|
if not exists(FULL_LIB_LOCATION):
|
||||||
|
# In that case, the Java version is very likely >=9.
|
||||||
|
# So we need to modify the `libjvm.so` path.
|
||||||
|
LIB_LOCATION = 'lib/server/libjvm.dylib'
|
||||||
|
|
||||||
INCLUDE_DIRS = [
|
INCLUDE_DIRS = [
|
||||||
'{0}/include'.format(FRAMEWORK),
|
'{0}/include'.format(FRAMEWORK),
|
||||||
'{0}/include/darwin'.format(FRAMEWORK)
|
'{0}/include/darwin'.format(FRAMEWORK)
|
||||||
|
@ -181,6 +193,17 @@ else:
|
||||||
INCL_DIR = join(JDK_HOME, 'include', 'linux')
|
INCL_DIR = join(JDK_HOME, 'include', 'linux')
|
||||||
LIB_LOCATION = 'jre/lib/{}/server/libjvm.so'.format(CPU)
|
LIB_LOCATION = 'jre/lib/{}/server/libjvm.so'.format(CPU)
|
||||||
|
|
||||||
|
if isinstance(JRE_HOME, bytes):
|
||||||
|
JAVA_HOME = dirname(JRE_HOME.decode())
|
||||||
|
else:
|
||||||
|
JAVA_HOME = dirname(JRE_HOME)
|
||||||
|
FULL_LIB_LOCATION = join(JAVA_HOME, LIB_LOCATION)
|
||||||
|
|
||||||
|
if not exists(FULL_LIB_LOCATION):
|
||||||
|
# In that case, the Java version is very likely >=9.
|
||||||
|
# So we need to modify the `libjvm.so` path.
|
||||||
|
LIB_LOCATION = 'lib/server/libjvm.so'
|
||||||
|
|
||||||
INCLUDE_DIRS = [
|
INCLUDE_DIRS = [
|
||||||
join(JDK_HOME, 'include'),
|
join(JDK_HOME, 'include'),
|
||||||
INCL_DIR
|
INCL_DIR
|
||||||
|
|
Loading…
Reference in New Issue