JavaFX applications built to target Java 8 - How to keep running with Java 11? - javafx

I recently learned about JavaFX not being included in Java 11, and have a question about how this will work.
Right now, I maintain an application that targets Java 8, uses mostly Swing but some JavaFX, and has a non-developer user base. Some of those users are on older operating systems, so I'd like to continue targeting Java 8.
However, Java 11 comes out next month, and I'm concerned that some of the users on newer operating systems will upgrade to Java 11, and the JavaFX components of the application will cease to work.
So what is the best path forward if you wish to continue targeting Java 8, but have JavaFX work for those who install JRE 11? I see several options, none of which are perfect:
Require installing JavaFX separately. If so, I'll need to know which edition - most likely the OS-specific SDK from https://gluonhq.com/products/javafx/? Not ideal since it's another install, but I already have instructions for installing Java for those who don't have it.
Bundle a JRE and JavaFX, and have startup scripts that force the use of that JRE. Not ideal because the download size would drastically increase, and it would require separate downloads per OS, but I've made distributions that bundle a JRE before.
Fall back on Swing instead of JavaFX if Java 11+ is detected. I could potentially do this, since my application started out as Swing and only a fraction has migrated, but it's also not attractive since the newer, JavaFX-specific functionality I've added would be lost.
Try including the JavaFX runtime as a .jar file and loading it on the classpath manually, perhaps only if Java 11+ is detected?
I'm curious what your thoughts are, and if there's a better option I've overlooked. I didn't anticipate JavaFX being removed from the JRE someday when I adopted it!

To my opinion the days where you asked your users to install Java on their client machines is over. The better solution is to create an operating system dependent installer which bundles everything with the application. I am also wondering if the size of such a bundle still really matters. A single video downloaded from YouTube is probably much bigger. Instead, by bundling you save yourself a lot of headaches.

Related

Running QT5 in an embedded device with 64 MB RAM

I have been working with QML for a couple of weeks now. But now a new requirement has risen where I have to check whether I can run QT5 in an embedded device for my project. I need this for my GUI related operations. The device has an ARM processor (Intel ARM920T-PXA27x processor to be exact) with 64 MB RAM. 32 MB will be taken up for the OS and the rest will be available for application and QT.
I have to check whether this is possible. I have googled for some references and unable to find a suitable answer to my requirement with QT5. I need the GUI libraries but my project does not have advanced graphical requirements like swiping or animations. It contains basic controls like texts, buttons and lists/grids. Since I am new to QT especially to this part, I would like to hear whether
1) Is this a viable option and should I keep digging more into this? Any feedback would be welcome to know if it's worthy to spend time to attempt this or if it's a lost cause.
2) If there are options, could you point me in the right direction to look more into this?
It depends on the OS you are running on your SOC.
It's definitely possible when running Linux. You can e.g. use Qt Lite for configuring a minimal static build of Qt. Then you deploy your statically linked application to the device. You can check this blog post for experiences with Qt Lite.
One possibility is to go with Qt for Device Creation for the whole embedded Linux based software stack which boots to a UI implemented with Qt technologies.

Challenges in upgrading desktop application in Swing to JAVAFX

I have a telecom desktop application(EMS) developed in java Swing. Its an old application developed and maintained in swing from last 10 years. Now we are planning to update GUI pages using javaFX technology for better and clean look & feel.
I had gone through various stack overflow discussion stating difference between javaFX and Swing. Please someone help me to understand the challenges in upgrading to javaFX GUI considering below constraints:-
-Application needs to be deployed in Unix, Solaris, HPUX, MAC and window 7/8 OS
-Some third party jars are also used along with JRE
-Current supported JRE is java 7
-There could be a plan to support android/apple/blackberry handheld devices
-We are not using Database for persistence but live data to display.
This answer is based on the detailed constraints of the question and is not a general comment on Swing to JavaFX ports. Parts of this answer will inevitably get outdated, perhaps fairly quickly.
Given your constraints, you can't upgrade your application to JavaFX.
Solaris and HPUX are not supported deployment platforms for JavaFX and that is unlikely to change.
The only way you could get JavaFX to work on Solaris or HPUX would be to use an unsupported configuration such as running a VirtualBox VM on Solaris or HPUX as the host OS, and in the VM run a supported OS, such as RedHat 6 or Oracle Linux 6, then running your JavaFX application within the supported OS - this may or may not work.
Also, I think it unlikely JavaFX would be ported to run on blackberries any time soon. There are ports of JavaFX to other mobile platforms, and they work for simple applications. I haven't tried them and think of JavaFX applications targeting such ports as a bit experimental at this stage. Such ports do not execute on an Oracle JVM and JRE, so if you use external libraries they have to be compatible with the port runtime (e.g. the Android Development Kit, RoboVM libs etc).
If you ported parts of your application to JavaFX, I would recommend running on a minimum of Java 8 rather than Java 7. Many bugs were fixed and many new features were implemented in JavaFX for Java 8. In particular for a Swing->JavaFX port, the integration capabilities of JavaFX and Swing were improved in Java 8 with SwingNode. To help ensure your target systems have the correct runtime installed you can package your application with an appropriate JRE as a self-contained application.
Of course, if you can relax your constraints a bit, there are many positive points for JavaFX.

Qt X11 application built for Windows platform

I know it is weird but I need to execute a Qt GUI application that supports X11 protocol on MS Windows platform.
It is obvious that if I build my Qt source code in Unix environment it automatically becomes an X11 application and this application can be run only on Unix Operating Systems, not MS Windows.
I tried to use MXE (MinGW cross environment) to compile my application in Unix for Windows, but it does not help for X11 issue. It creates an application for Windows but the application is not an XWindow application.
There is also a XPortMinGW project for minGW. But I do not know if it works for Qt applications.
Is there any way to build my Qt application with X11 support that can run in Windows OS?
I don't think that there's any need for cross-compilation. There are two problems:
Getting Xlib compiled for Windows. I don't know offhand of any maintained Xlib implementations that are ported to Windows. You will definitely need to find one, or make one. Hopefully Xlib depends only on a handful of posix APIs and they may be easy to translate to win32. Forget about Cygwin.
You may have luck porting Xlib yourself to Qt's network backend and making it cross-platform in the process, too. Xlib would simply use the core and network modules of Qt. No problem with that.
The good news here are that Qt 5 comes with a bundled Xlib implementation. It would be presumably much easier to get that to compile on Windows than some other implementation.
Configuring Qt to build using said Xlib on Windows. To do it right, you'll probably want to mess a bit with and rebuild the configure tool that comes with Qt, and add a makespec that will link with the Xlib.
This should be much easier to do with Qt 5.
It's not an entirely trivial thing to do, but should be possible. Give yourself a month and expect to get very intimate with some details of Qt's configuration and Xlib.
Notes About Cygwin
If your application is closed-source and distributed outside of your organization, you need to buy a commercial license in order to redistribute cygwin.dll. Otherwise, Cygwin is GPL and merely linking to cygwin.dll makes your application a derived work.
Cygwin becomes problematic when you mix posix- and non-posix code in the same application, especially if the non-posix code is a large framework like Qt. You can of course use the Posix platform code in Qt and make it all run on Cygwin, but that way you lose performance and expose yourself to shortcoming of Cygwin's emulation of POSIX APIs.
Using Cygwin for Xlib / windowing system but having Qt otherwise use Windows APIs may require a lot of tweaking for Qt code. So may using Qt with Xlib on Windows of course, but at least you don't have to debug/work around Cygwin's quirks.

How to update Flex SDK in Flash Builder 4.6

As an owner of Flash Builder 4.6 I'm struggling with 2 problems in my web application:
XML parsing makes the whole application sluggish
Russian input in TextInput doesn't work with Opera
I wonder, if there is a new Flex SDK available for download, where some fixes might have been integrated since the Flash Builder 4.6 release several months ago.
So I have downloaded the "Flex SDK version 4.6.0.23201 is the latest production quality release" and installed it:
However this seems to be a version, which differs very little from the stock Flex SDK included with Flash Builder 4.6 originally.
My questions is: is there some good (i.e. fresh, but also tested/stable) source for Flex SDK, which would be suitable for Flash Builder 4.6?
Maybe I can check out the source from some repository and build it myself (how, please?).
Does Apache offer anything, since they are the new owners?
UPDATE:
I've checked out Apache's Flex with
svn co https://svn.apache.org/repos/asf/incubator/flex/trunk flex
(and have yet to figure out, how to build it) - isn't it newer and better?
is there some good (i.e. fresh, but also tested/stable) source for
Flex SDK, which would be suitable for Flash Builder 4.6?
Yes, that would be Adobe. I am not aware of any updates to Flex 4.6 since it's release late last November. It's only been three months. I believe the bulk of Adobe's work around Flex has been getting legal approval to submit Flex to Apache. They are getting that slowly.
You can download the source for the Adobe Flex SDK from opensource.adobe.com. Read this for info on getting the source from the Adobe SVN repository.
Does Apache offer anything, since they are the new owners?
The Apache project is still formally waiting for donations from Adobe, including their testing suite. But, some code is submitted from Adobe. A few people have submitted some new components, and there has been work done around localization. The Apache project does not have a formal release yet.
You should be able to get the Apache Source from SVN as an anonymous user. The trunk includes the framework dump from Adobe; but I haven't delved in myself. I know people have successfully built the Flex SDK from the Apache trunk. Here are some instructions on how to do it with IntelliJ
I should add that I'm not sure if updating the SDK will solve any XML parsing issues you have. But, it's tough to say for sure since you went into no details on what those issues are. My mobile game uses a 30K line, 1MB XML file for the level definitions and it has no problems parsing it effeciently.
Flex SDK sources
You can find the latest source code through the Flex Apache incubator page and use Subversion to check it out. However since the migration of the Flex SDK from Adobe to the Apache foundation is still very much in progress, I sincerely doubt that there would already be significant changes that would fix your issues.
The actual issues
XML parsing makes the whole application sluggish
XML parsing is a pure ActionScript matter and has nothing to do with Flex. It is closely related to how the Flash VM works, which is still closed property of Adobe. I don't think it is subject to change any time soon, mostly because I've heard very little complaints about its performance and the E4X language is one of the most powerfull around. If you're having performance issues better have a look at your architecture or work with AS model objects instead of XML.
Russian input in TextInput doesn't work with Opera
This is either related to the Flash VM (see above) or to the Text Layout Framework, which is "open-source", but still in the hands of Adobe. Whether it should also be contributed to Apache Flex is still being discussed. In both cases very little will change in the short future, so I think you'll have to try another approach.
Are you sure it has anything to do with the SDK? If the problem of cyrillic chars exists only in Opera - then it's more like a problem of Opera and its Flash-plugin.
This is what you get with Flex SDK 4.5 and Opera 11.61:
There might be another problem if you're using some font that doesn't have the cyrillic char subset (e.g. not using the default font). But if that were it, it would affect all browsers, not just Opera.
привет землякам!

Recommended project structure for Flex builds

I'm starting a new project using Flex3 for a reasonably intricate UI getting its data from a collection of RESTful web services. I wondering what experiences others have had in structuring a moderately complex Flex project. The issues I'm thinking about include:
I want to use our FlexBuilder licenses for visual editing of layouts and debugging code on Eclipse
automated build script so that we can use a CI server
testing strategies, particularly automatable unit tests
cross-platform Linux and Windows development environments (yes, I know the Linux version of FlexBuilder doesn't do visual editing, but everything else should ideally run cross-platform)
dependency management for at least the Java code (are there library dependency managers for Flex?)
I've just burned a day trying and failing to get a maven2/flex/jetty build setup working smoothly (based on Jeff Maury's tutorial). I'm not dead-against using Maven as we go forwards, but I'm sure there must be a less painful route. The main issue I had (other than maven documentation being patchy) is that maven's "single artifact per build" rule means that you have to jump through a lot of hoops with a complex build, and I'm not enough of a maven initiate not to trip over the hoops and fall on my face!
Would Ant and Ivy be a better option than maven2? What other choices are there?
I don't know Flex development but I know CI so I'll comment on that aspect.
I work on CruiseControl, so that's what I use (when not being paid to setup something else). And there are blog entries that describe setting up Flex projects under CC for both Windows and Linux. CC has been around for a long time so there is a large community of users and lots of 3rd party tools that work with it.
But other people are likely to recommend Hudson and it would be hard to argue against them. Hudson is very easy to get up and running and has a nice web based UI. This project is very active, has lots of fans and lots of buzz and has matured very rapidly. I don't have anything bad to say about it. This blog entry describes running acceptance tests under Hudson.
I don't know enough about Maven to offer advice there but I'm working with Ivy at a client right now and I really like it. We've got a combination of Java and C++ code and we're able to get Ivy to do what we need.
Well we are using maven. With some help of a lot of different web sties I have an enterprise application being built using maven.
This article via adobe has really help a lot.
http://www.adobe.com/devnet/flex/articles/fullstack_pt1.html
http://www.adobe.com/devnet/flex/articles/fullstack_pt2.html
http://www.adobe.com/devnet/flex/articles/fullstack_pt3.html
You really need a common configuration project that will be shared between both flex and java, and possibly your c++ code. This article explains how to set that all up.
Down side, if you are not knowledgeable with maven there is a slight learning curve.

Resources