次のスクリプトはUbuntuでは動作しますが、Macでは動作しません。なぜ?ここでも機能させるにはどうすればよいですか?
#!/bin/sh
v=1.1
test_file="Test10.java"
jar_file="dp4j-$v-jar-with-dependencies.jar"
curl -O "http://repo2.maven.org/maven2/com/dp4j/dp4j/$v/$jar_file"
# Start
cat > $test_file << __EOF__
class T10 {
private static void p(int i, Double d, String... s){}
}
public class Test10{
@com.dp4j.InjectReflection
public void t() {
T10.p(1,new Double(2),"hello", "reflection");
}
}
__EOF__
cat $test_file
cmd="javac -Averbose=true -cp $jar_file $test_file"
echo $cmd
$cmd
Macからの出力:
$ sudo ./TESTDRIVE
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 341k 100 341k 0 0 1516k 0 --:--:-- --:--:-- --:--:-- 3248k
class T10 {
private static void p(int i, Double d, String... s){}
}
public class Test10{
@com.dp4j.InjectReflection
public void t() {
T10.p(1,new Double(2),"hello", "reflection");
}
}
javac -Averbose=true -cp dp4j-1.1-jar-with-dependencies.jar Test10.java
error: error reading dp4j-1.1-jar-with-dependencies.jar; cannot read zip file
...
$md5 dp4j-1.1-jar-with-dependent.jar MD5(dp4j-1.1-jar-with-dependent.jar) = eb04d0d357fd861ac414fde7d3530119