33 lines
583 B
Bash
33 lines
583 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
set -e
|
||
|
|
||
|
if [ -e jdk.tar.gz ]; then
|
||
|
rm -f jdk.tar.gz
|
||
|
fi
|
||
|
curl -o jdk.tar.gz https://hg.openjdk.java.net/jdk/jdk11/archive/tip.tar.gz
|
||
|
|
||
|
if [ -d ../src/main/c/jni ]; then
|
||
|
rm -rf ../src/main/c/jni
|
||
|
fi
|
||
|
mkdir ../src/main/c/jni
|
||
|
|
||
|
if [ -d jdk ]; then
|
||
|
rm -rf jdk
|
||
|
fi
|
||
|
mkdir jdk
|
||
|
tar -zxf jdk.tar.gz --strip-components=1 -C jdk
|
||
|
|
||
|
rm -f jdk.tar.gz
|
||
|
|
||
|
cp -r jdk/src/java.base/share/native/include/. ../src/main/c/jni
|
||
|
|
||
|
copy_jni() {
|
||
|
mkdir "../src/main/c/jni/$1"
|
||
|
cp -r "jdk/src/java.base/$1/native/include/." "../src/main/c/jni/$1"
|
||
|
}
|
||
|
|
||
|
copy_jni unix
|
||
|
copy_jni windows
|
||
|
|
||
|
rm -rf jdk
|