mirror of https://github.com/kivy/pyjnius.git
Adjust java detection so it's more likely to work on jdks that write -version to stderr.
This commit is contained in:
parent
9b776e214a
commit
7d5a8fa6a4
2
Makefile
2
Makefile
|
@ -10,7 +10,7 @@ PYTHON=python
|
|||
NOSETESTS=nosetests
|
||||
endif
|
||||
|
||||
JAVA_TARGET ?= $(shell javac -version | $(PYTHON) -c "import re; print('1.6' if int(re.findall(r'\d+', input())[0]) < 12 else '1.7')" )
|
||||
JAVA_TARGET ?= $(shell $(PYTHON) -c "import re; print('1.6' if int(re.findall(r'\d+', '$(shell javac -version 2>&1)')[0]) < 12 else '1.7')" )
|
||||
JAVAC_OPTS=-target $(JAVA_TARGET) -source $(JAVA_TARGET)
|
||||
JAVAC=javac $(JAVAC_OPTS)
|
||||
|
||||
|
|
3
setup.py
3
setup.py
|
@ -95,7 +95,8 @@ def compile_native_invocation_handler(*possible_homes):
|
|||
source_level = '1.6'
|
||||
# We have to check what version of javac this is, because -target 1.6 is
|
||||
# no longer supported on JDKs >= 12.
|
||||
javac_version = subprocess.check_output([javac, '-version'])
|
||||
javac_version = subprocess.check_output([javac, '-version'],
|
||||
stderr=subprocess.STDOUT)
|
||||
for m in re.finditer(r'\d+', javac_version.decode('ascii')):
|
||||
if int(m.group(0)) >= 12:
|
||||
source_level = '1.7'
|
||||
|
|
Loading…
Reference in New Issue