1 |
jsr166 |
1.1 |
#!/bin/bash |
2 |
|
|
# Makes a library jar file java 7 compatible |
3 |
|
|
set -eu |
4 |
|
|
JAVA8_HOME="$HOME/jdk/jdk8"; export PATH="$JAVA8_HOME/bin:$PATH" |
5 |
|
|
[[ -d "$JAVA8_HOME/bin" ]] || { echo "where's java8?"; exit 1; } |
6 |
|
|
|
7 |
|
|
[[ "$PWD" =~ lib$ && -f jtreg.jar ]] \ |
8 |
|
|
|| { echo "run in lib directory"; exit 1; } |
9 |
|
|
|
10 |
|
|
LIB=jtreg |
11 |
|
|
rm -rf "$LIB" |
12 |
|
|
mkdir "$LIB" |
13 |
|
|
( |
14 |
|
|
cd "$LIB" |
15 |
|
|
jar xf "../$LIB.jar" |
16 |
|
|
|
17 |
|
|
wget -q -O "retrolambda.jar" "http://search.maven.org/remotecontent?filepath=net/orfjackal/retrolambda/retrolambda/2.3.0/retrolambda-2.3.0.jar" |
18 |
|
|
|
19 |
|
|
java \ |
20 |
|
|
-Dretrolambda.inputDir=. \ |
21 |
|
|
-Dretrolambda.classpath=../javatest.jar \ |
22 |
|
|
-jar retrolambda.jar |
23 |
|
|
jar cmf META-INF/MANIFEST.MF "../$LIB.jar" . |
24 |
|
|
) |
25 |
|
|
rm -rf "$LIB" |