|
Accueil - E4 SWT Java for Flash: running the demos
Created :
Last modified : E4 SWT Java for Flash: running the demos![]() Eclipse foundation recently have released Eclipse E4 Milestone 1 with the support of so called ActionScript development environment for SWT. It means that you can now export Java applications for the Flash Player. There is some pretty good instructions to run some demos. I've played with it last night. This post is intended to give you a quick overview of the whole thing with an ActionScript developer point of view. The installation process is easy. You mainly have to download Eclipse SDK 3.5M4, install some updates, the Adobe Flex SDK 3 and configure the Eclipse environment. It takes less than an hour if you have a good connection and sufficient knowledge of what we are talking about. Just do not forget anything and cross your finger, as the E4/SWT team said: "[..] both the tools and the port are in the pre-alpha stage. You are living on the bleeding edge. Good luck!". Here is what the Eclipse E4 environment looks like when the examples project is opened (note that the tests were done on Windows XP 32) : When installed we have 7 demo applications to run from a Java project:
How it worksTo summarize, all the code here is Java code. None of the examples use reference to Flex SDK code nor Flash Player specific code, even the one that displays Flex controls. It all uses SWT code with its specific API. Each example use a generic SWT wrapper written in Java and exported in ActionScript that control at runtime the access to standard Flash/Flex specific code. The code (not sure if it is the whole code) of this wrapper can be found in workspace\org.eclipse.swt\Eclipse SWT\flex\org\eclipse\swt\widgets. To summarize the wrapper works with shunts like : What you may want to know, is you need to add a JRE to your Eclipse Environment that is called "Java 1.5 for ActionScript (J2AS-1.5)" what I believe to be first the J2AS project from osflash.org, but it is not. What I understand here is it means that each line of code you wrote will not be managed by the Standard JRE but by this specific "Java 1.5 for ActionScript" JRE. It seems to mainly uses a named "actionscriptJCL.jar" located in Eclipse environment plug-ins dir. Running a Flash applicationBefore you can launch the demos you need to set your Intenet Explorer or Firefox directory. So when you debug the projects, applications run in the browser of your choice. When launched in debugging mode, the Flash player debugger connects to the Java debugger and it works as you are used to with the Flex debugger! It means that you can see the "internals" of the running application. All associated to Java code only. You still never see any ActionScript code here, even any stub code. I have quickly tested to launch JProfiler, it seems not possible to connect it to the demos even in debugging mode when the Eclipse debugger is used. To be honest I don't know how profiling junction to debugger works in Eclipse. So I don't know if it is possible to profile a Flash application even from the ActionScript development environment for SWT. The bad newsNow the bad news is when exploring the generated SWF files for each demo, we can see that what I call the SWT ActionScript wrapper is a SWF file named org.eclipse.swt.swf that weighs 960KB, common code for the examples 160KB and other files make any of the demo launched to load something like 2MB before to launch. It excludes to use any SWT generated application on any high audience public website. I have not thought much about this, but I can't see any problem to compile a Java application for Air from SWT. Finally as Air is local only, it could be the only interesting usage for this project since library sizes are so important. Worth a tryI can't give you any link to an online demo because when compiled each application load its dependencies (the incriminated fat SWF files) with a URL prefixed by So even if the weight of a whole application is a bad news, it is worth a try. Hope this helps. You may be also interested in reading Eclipse E4 M1 SWT: JAVA to AS3 blog post from Ted Patrick. CommentsIf we assume that this project can generate libraries as SWF or SWC. I suppose that we can ask any Flash application to compile while using the code generated from Java and located in the SWF/SWC used as libraries. I follow the instructions and get to this point: Grimesters, the main E4 downloads page is : http://download.eclipse.org/e4/downloads/ Actually you can find the file you are looking for on this page : http://download.eclipse.org/e4/downloads/drops/S-0.9M1-200902061045/index.html It is named : org.eclipse.swt.e4.flex-0.9M1.zip (not a timestamp though). Hi Tek, thanks a bunch for the help, excellent. I got as far as compiling/trying to run the examples but just got loads of errors. Guess this is pretty bleedin edge stuff! I’ll look again at the weekend. @Grimesters> You normally have “only” 1851 warnings but no errors at all. Are you sure not have forgiven to configure what they call the “ActionScript VM” ? I had plenty of errors too when first missed this step. […] “Flash/Flex Killer” solutions (Silverlight & JavaFX), here comes a real threat Eclipse E4 & SWT. Instead of pushing for a new platform, Eclipse has come out a really brilliant idea. The latest […] i cannot find “ActionScript VM” option. You can access it via : Preferences>Java>Installed JREs. All is explained at the fourth step of “Setup the Eclipse target environment”. Let me know if it works for you. Yes, i just follow the steps Add a new ActionScript VM. (’Window’ -> ‘Preferences’ -> ‘Java>Installed JREs’). 1. Click Add… in the step 2. Select ActionScript VM, click next. i cannot find “ActionScript VM” this option, only standard VM …., and what is ActionScript VM? For the flex setup, and i use eclipse-SDK-3.5M4-win32, so SWT ActionScript tools should already be there. Gembin I think that your error is that even SDK-3.5M4 needs org.eclipse.swt.e4.flex-I[timestamp].zip archive, it’s why you don’t have Actionscript VM that appears right in the window we’re talking about previously. Yes, i downloaded org.eclipse.swt.e4.flex-0.9M1.zip, but it is source code not a JAR binary . and i already imported Existing projects into workspace as the instructions said. BUT, i think there should be eclipse plugins for org.eclipse.swt.e4.flex which should be put to the eclipse plugins dir, and i cannot find it. Very nice introduction and review! I am also trying to follow the steps and run the demo. But where can I downlaod the J2AS-1.5 from? James @James As I can remember it is not something you have to download. It must be here when you have installed the SWT ActionScript development tools. I’ve also a question about the ActionScript VM (Run as …) I tried all the versions of e4 and I’m not be able to setup ActionScript VM. I followed all the steps at http://wiki.eclipse.org/E4/SWT/Running_the_demos more than five times(on all Milestones and release candidates). Entry eclipse.ini Hopefully you have some hints for me … Sorry Kai, but I can at least only tell you to try to start eclipse with : eclipse.exe -clean I’ve the same problems. I can’t find the ActionScript VM. What i’ve done: 1 Download the e4 build 0.0 http://download.eclipse.org/e4/downloads/drops/R-0.9-200907291930/index.html#EclipseE4 2 install new software http://download.eclipse.org/e4/downloads/drops/R-0.9-200907291930/repository => Eclipse e4 ActionScript Developer Tools (Incubation) .9.0.v20090609-1530-47L-9oB55W5I5O28OE5 => Eclipse E4 SWT ActionScript Source (Incubation) 0.9.0.v20090609-1530-47L-9oB55W5I5O28OE5 3 install the flex incubation (export into the current project) org.eclipse.swt.e4.flex-incubation-0.9.zip 4 shutdown eclipse and manipulate eclipse.ini Entry eclipse.ini ———————— So know everybody how we can bring this e4 with flex to run ? i’ve more questions 1 what to hell is => Select Project>Popup Menu>Action Script Tools>Toggle Nature. 4 Preferences’ -> ‘Workspace’ -> ‘Linked Resources’/ where can i find this one. whoever have a full working eclipse(swt to flex) installation it’s possible to zip the full directory and put this on my server ? i can set this free for everybody thanks send me a message to von_schrenk@yahoo.co.uk then we can arrange this. @Frank Select Project>Popup Menu>Action Script Tools>Toggle Nature is a standard Flex Menu. In Flex it is used to convert a standard ActionScript Project to a Flex SDK project. You don’t need it now for sure. Sorry, but I do not have the Eclipse environment that runs with E4 SWT anymore. I cannot upload you the archive. Another thing that will make it harder is that I think the article http://wiki.eclipse.org/E4/SWT/Running_the_demos has been modified since I wrote this post. at least it means that now this page is up to date for the last Eclipse build. Cannot help you more. Leave a comment |
||
| wordpress rss rss français rss english xhtml 1.1 css 2.0 wdg |
Very interesting… does it mean that we can mix as3 and java code and compile everything in a single swf or is it only java to swf ?