diff options
author | Leo Ufimtsev | 2018-04-12 15:31:09 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-04-13 06:11:25 +0000 |
commit | 104e4028712414d8d18700491e038d8daa5f9721 (patch) | |
tree | dd49036324a81453762e7da82d689ef6f5993df4 /bundles/org.eclipse.swt/Eclipse SWT PI | |
parent | f97d518394ee6f939b6f7151e7b0d8d90fef5b16 (diff) | |
download | eclipse.platform.swt-104e4028712414d8d18700491e038d8daa5f9721.tar.gz eclipse.platform.swt-104e4028712414d8d18700491e038d8daa5f9721.tar.xz eclipse.platform.swt-104e4028712414d8d18700491e038d8daa5f9721.zip |
Bug 533496 – Add mechanism to find 32 bit java in GTK build.sh
Dynamically find JAVA_HOME for 32bit java on a system that also has
64bit java installed.
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=53349632
Change-Id: I84cd5b44078f22da3226971122dfcb38ac060895
Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh index 9ce186fd45..55381f3177 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh @@ -127,8 +127,20 @@ case $SWT_OS.$SWT_ARCH in export CC=gcc fi if [ "${JAVA_HOME}" = "" ]; then - export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.i386" - export AWT_LIB_PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.i386/jre/lib/i386 + + # Dynamically find JAVA_HOME for 32bit java on a system that also has 64bit java installed. + # We cannot use `readlink $(which java)` or related methods as they point to the 64 bit java. + # So instead we find the path manually and assume java.i386 is installed in the default /ur/lib/jvm path. + # This matches folders such as: + # java-1.8.0-openjdk-........i386 + # java-9-openjdk....i386 + JAVA_FOLDER=$(ls /usr/lib/jvm | grep java | grep -i openjdk | grep i386 | sort | tail -n 1) + if [ "${JAVA_FOLDER}" == "" ]; then + func_echo_error "ERROR: Could not find JAVA_HOME/AWT_LIB_PATH on 32bit build system automatically. Expecting it to be in /usr/lib/jvm/ but none was found. See also Bug 533496" + fi + + export JAVA_HOME=/usr/lib/jvm/${JAVA_FOLDER} + export AWT_LIB_PATH=$(JAVA_HOME)/jre/lib/i386 fi if [ "${PKG_CONFIG_PATH}" = "" ]; then export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/bluebird/teamswt/swt-builddir/cairo_1.0.2/linux_x86/lib/pkgconfig" |