FXML - Java Compiler [message #1239158] |
Mon, 03 February 2014 09:13  |
Eclipse User |
|
|
|
Hi Tom!
I was checking your sample project for FXML - Java Compiler because definitely that's something we really need. The gained speed between fxml and java on low power devices is considerable!.
However, at least on my computer. The java generated receive a wrong package name: "package \demo;" and therefore when ant tries to compile with javac, it fails:
[javac] Compiling 2 source files to C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\classes
[javac] C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\gen-src\demo\Login.java:1: error: illegal character: '\'
[javac] package \demo;
[javac] ^
[javac] C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\gen-src\demo\Login.java:1: error: class, interface, or enum expected
[javac] package \demo;
[javac] ^
[javac] C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\gen-src\demo\Profile.java:1: error: illegal character: '\'
[javac] package \demo;
[javac] ^
[javac] C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\gen-src\demo\Profile.java:1: error: class, interface, or enum expected
[javac] package \demo;
[javac] ^
[javac] 4 errors
I'm using the argument: -Dbuild.compiler=javac1.7
Because otherwise I have a compiler not found javac1.8
At the moment I'm using ant 1.8.4
And my second question.
Assuming that I have the generated java and .class: I see that are under the folder build\classes\demo\
As far as I understood from your blog post, the ExtendedFXMLLoader.java will grab from the build folder the binary class files right? So basically in my application I should run the Ant script and in the Part.java use the ExtendedFXMLLoader instead of the FXMLLoader.
Is this open sourced already? we pointed our project today to the efxclipse 0.9 release but I don¡t see there the FXML-compiler classes. Perhaps I'm missing something in the target url (http://download.eclipse.org/efxclipse/runtime-released/0.9.0/site/) because I cannot see the org.fx.eclipse.fxml bundle
Thanks!!
|
|
|
Re: FXML - Java Compiler [message #1239177 is a reply to message #1239158] |
Mon, 03 February 2014 10:06   |
Eclipse User |
|
|
|
Hi,
a) yes everything is opensourced
- ExtendedFXMLLoader is part of "org.eclipse.fx.core" which is part
of the runtime p2 repo
- The compiler is a build / time tool so it is *not* part of the
runtime p2 repo - it is found in "org.eclipse.fx.ide.fxml.compiler"
b) you get the compiler itself not as part of an update-site but as an
extra download [1]
c) Yes you simply replace the FXMLLoader through calls to
ExtendedFXMLLoader - but it will not search an extra classpath but
simply the classpath of your project so you need to make sure that
the generated .class-Files are packaged
In my sample ant-script you'll see that this is a 2 fold process:
* compile the project source using javac
* translate the FXML => Java-Files with the "compiler"
* compile the generated FXML-Files using javac
The reason for this 2 step process is that the "fxml-compiler" needs
e.g. the control to find out if it still has to use reflection to
access fields
d) On your compilation problem - it somehow looks like there's a "\" to
less stripped when calculating the path. Can you please give the
compiler from the release a try
e) Note that there are still gaps in the compiler that have to be
closed - e.g. the possibility to deal with include-directives, ... .
So if you come across any problems please file bug reports
f) -Dbuild.compiler=javac1.7 - yes this is a problem of a too old ANT
shipped with Eclipse. It will be fixed with Luna.
Tom
[1]http://download.eclipse.org/efxclipse/compiler-released/0.9.0/org.eclipse.fx.fxml.compiler_0.9.0.jar
On 03.02.14 15:13, Pablo Gomez wrote:
> Hi Tom!
>
> I was checking your sample project for FXML - Java Compiler because
> definitely that's something we really need. The gained speed between
> fxml and java on low power devices is considerable!.
>
> However, at least on my computer. The java generated receive a wrong
> package name: "package \demo;" and therefore when ant tries to compile
> with javac, it fails:
>
>
>
> [javac] Compiling 2 source files to
> C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\classes
>
> [javac]
> C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\gen-src\demo\Login.java:1:
> error: illegal character: '\'
> [javac] package \demo;
> [javac] ^
> [javac]
> C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\gen-src\demo\Login.java:1:
> error: class, interface, or enum expected
> [javac] package \demo;
> [javac] ^
> [javac]
> C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\gen-src\demo\Profile.java:1:
> error: illegal character: '\'
> [javac] package \demo;
> [javac] ^
> [javac]
> C:\Users\gomez\workspaces\eclipse\ws_kepler_laboratory\CompilerTest\build\gen-src\demo\Profile.java:1:
> error: class, interface, or enum expected
> [javac] package \demo;
> [javac] ^
> [javac] 4 errors
>
>
>
> I'm using the argument: -Dbuild.compiler=javac1.7
> Because otherwise I have a compiler not found javac1.8
> At the moment I'm using ant 1.8.4
>
> And my second question.
>
> Assuming that I have the generated java and .class: I see that are under
> the folder build\classes\demo\
>
> As far as I understood from your blog post, the ExtendedFXMLLoader.java
> will grab from the build folder the binary class files right? So
> basically in my application I should run the Ant script and in the
> Part.java use the ExtendedFXMLLoader instead of the FXMLLoader.
>
>
> Is this open sourced already? we pointed our project today to the
> efxclipse 0.9 release but I don¡t see there the FXML-compiler classes.
> Perhaps I'm missing something in the target url
> (http://download.eclipse.org/efxclipse/runtime-released/0.9.0/site/)
> because I cannot see the org.fx.eclipse.fxml bundle
>
> Thanks!!
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06110 seconds