トップ «前の日記(2009-12-02) 最新 次の日記(2009-12-04)» 編集

日々の破片

著作一覧

2009-12-03

_ jrunscriptでJavaFXを使う。

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 個

バグレポートを出せと書いてあるから後で出そう。


2003|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|03|

ジェズイットを見習え