Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
#================================================================================
# This script fetches and builds the latest OpenJDK9 and OpenJFX (currently 8u40)
# and installs OpenJFX into the OpenJDK j2sdk image.
#
# It requires an existing 1.8 JDK installation to bootstrap the OpenJDK build
# (I used Oracle jdk1.8.0_20).
#
# Tested on Debian x86_64 (Squeeze and Wheezy)
#
# You might want to run this one step at a time rather than as an unattended
# script until you're happy it works correctly on your system.
#
# Once you've fetched each project you can comment out the hg clone parts
# and just rely on the hg updates to keep in sync with OpenJDK and OpenJFX
#
# Copyright (c) 2014 Chris Newland.
# Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD
#
#================================================================================
export HOME=/home/chris
export OPENJDK9=$HOME/openjdk9
export OPENJFX=$HOME/openjfx
mkdir $OPENJDK9
mkdir $OPENJFX
#===========================================
# Set up bootstrap JDK (1.8 needed for JDK9)
#===========================================
export JDK_HOME=$HOME/jdk1.8.0_20
export JAVA_HOME=$JDK_HOME
#==============================================
# Install required Debian packages with apt-get
#==============================================
sudo apt-get install build-essential bison flex gperf libasound2-dev libgl1-mesa-dev \
libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libjpeg-dev \
libpng-dev libx11-dev libxml2-dev libxslt1-dev libxt-dev \
libxxf86vm-dev pkg-config qt4-qmake x11proto-core-dev \
x11proto-xf86vidmode-dev libavcodec-dev mercurial libgtk2.0-dev \
ksh libxtst-dev libudev-dev zip unzip libcups2-dev
#=================
# Fetch OpenJDK 9
#=================
hg clone http://hg.openjdk.java.net/jdk9/dev $OPENJDK9
cd $OPENJDK9
chmod u+x get_source.sh
./get_source.sh
#===========================================
# Update OpenJDK9 source (if already cloned)
#===========================================
cd $OPENJDK9
hg pull
hg update
#=================
# Build OpenJDK 9
#=================
cd $OPENJDK9
chmod u+x configure
./configure
make clean
make images
export OPENJDK9_J2SDK=$OPENJDK9/build/linux-x86_64-normal-server-release/images/j2sdk-image
#=================
# Fetch OpenJFX
#=================
cd $HOME
hg clone http://hg.openjdk.java.net/openjfx/8u-dev/rt $OPENJFX
#==========================================
# Update OpenJFX source (if already cloned)
#==========================================
cd $OPENJFX
hg pull
hg update
#========================================
# Fetch Gradle (if not already installed)
#========================================
cd $HOME
wget http://services.gradle.org/distributions/gradle-1.8-all.zip
unzip -o gradle-1.8-all.zip
export PATH=$PATH:$HOME/gradle-1.8/bin
#=================
# Build OpenJFX
#=================
cd $OPENJFX
gradle build
#========================================
# Copy OpenJFX into the OpenJDK SDK image
#========================================
cp $OPENJFX/build/sdk/rt/lib/javafx.properties $OPENJDK9_J2SDK/jre/lib
export BINARY_SOURCE=$OPENJFX/build/sdk/rt/lib/amd64/
export BINARY_TARGET=$OPENJDK9_J2SDK/jre/lib/amd64
cp $BINARY_SOURCE/libdecora_sse.so $BINARY_TARGET
cp $BINARY_SOURCE/libglass.so $BINARY_TARGET
cp $BINARY_SOURCE/libjavafx_iio.so $BINARY_TARGET
cp $BINARY_SOURCE/libprism_common.so $BINARY_TARGET
cp $BINARY_SOURCE/libprism_sw.so $BINARY_TARGET
cp $BINARY_SOURCE/libprism_es2.so $BINARY_TARGET
cp $BINARY_SOURCE/libjavafx_font.so $BINARY_TARGET
cp $BINARY_SOURCE/libjavafx_font_pango.so $BINARY_TARGET
cp $BINARY_SOURCE/libjavafx_font_freetype.so $BINARY_TARGET
cp $OPENJFX/build/sdk/rt/lib/ext/jfxrt.jar $OPENJDK9_J2SDK/jre/lib/ext
#=====================
# Test OpenJDK version
#=====================
$OPENJDK9_J2SDK/jre/bin/java -version
@chriswhocodes

This comment has been minimized.

Copy link
Owner Author

commented Sep 30, 2014

Removed dependency on jfr.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.