| 著作一覧 |
NetBeans 6.7に入ってくるJavaFXは、意外なところに入っていて、最初にそこに引っかかった。
以下に入っている。
c:\users\name\.netbeans\6.7\javafx-sdk\lib\shared\javafxc.jar
そこまでわかれば話は簡単だと思ったらまったく簡単ではない。
C:\test>jrunscript -cp C:\Users\arton\.netbeans\6.7\javafx-sdk\lib\shared\javafxc.jar -l javafx
fx> 3 + 4
Exception in thread "main" java.lang.NoSuchMethodError: com.sun.tools.javac.main.RecognizedOptions.getJavacFileManagerOptions(Lcom/sun/tools/javac/main/RecognizedOptions$OptionHelper;)[Lcom/sun/tools/javac/main/JavacOption$Option;
at com.sun.tools.javac.util.JavacFileManager.<clinit>(JavacFileManager.java:973)
...
調べたら、FAQらしい。中の人らしいA. Sundararajan's Weblogに、JavaFX固有のjavac改が必要なのにjrunscriptがオリジナルのjavacを持ってくるのが原因とか書いてある。
C:\test>jrunscript -J-Xbootclasspath/p:C:\Users\arton\.netbeans\6.7\javafx-sdk\lib\shared\javafxc.jar -l javafx
で起動成功。
リストの扱いが最近の言語っぽい。
fx> for (x in [0..5]) { println(x); }
0
1
2
3
4
5
fx> var a
fx> a = [0,1,2,3,4,5,6,7]
[ 0, 1, 2, 3, 4, 5, 6, 7 ]
fx> for (x in [0,1,2,3,4,5,6][n | n mod 2 == 0]) { println(x); }
0
2
4
6
しかし変数を使うとうまく動かない。
fx> var seq;
fx> seq = [0,1,2,3,4,5,6]
[ 0, 1, 2, 3, 4, 5, 6 ]
fx> for (x in seq[n | n < 3]) { println(x); }
mfm:///stdin34:1: 警告:iterating over a non-sequence
for (x in seq[n | n < 3]) { println(x); }
^
注:An internal error has occurred in the OpenJFX compiler. Please file a bug at the Openjfx-compiler issues home (https://openjfx-compiler.dev.java.net/Issues) after checking for duplicates.
Include in your report:
- the following diagnostics
- file C:\Users\arton\AppData\Loca\Temp\javafx_err_556696727745871515.txt
- and if possible, the source file which triggered this problem.
Thank you.
mfm:///stdin34:1: 互換性のない型
検出値 : java.lang.Object
期待値 : double
for (x in seq[n | n < 3]) { println(x); }
^
エラー 1 個
警告 1 個
バグレポートを出せと書いてあるから後で出そう。
ジェズイットを見習え |