Combining Java with the latest version of the toolkit can avoid application failures due to conflicts between multiple GTK versions.
Currently Oracle is planning to incorporate the GTK 3 GUI toolkit into Java 9 based on Linux systems. This will ensure that current Java is combined with the latest version of the toolkit, thereby preventing applications from experiencing failures due to conflicts between multiple GTK versions.
According to a Java enhancement proposal published on the openjdk.net website, the goal of this initiative is to support GTK (i.e. GIMP Toolkit) 2 by default and use GTK 3 when specified by system properties. Various Java graphics applications based on JavaFX, Swing or AWT (Advanced Container Toolkit) will be included in the recommended plan, and existing applications can also run on Linux without modification for GTK 2 or 3 above.
This proposal has been sent to members of the openjfx-dev mailing list by Mark Reinhold, chief architect of Oracle's Java Platform Division. Java 9 is expected to be officially released in March 2017.
"There are currently a large number of Java software packages using GTK, including AWT/Swing, JavaFX and SWT. SWT has been migrated to GTK 3, but it still contains a system property that can be used to force it to use an earlier version," This proposal states. "This practice of mixing different GTK versions within a software package may cause application failures."
This problem also particularly affects various applications that use the Eclipse development platform. The proposal also stated that although GTK 2 and 3 are currently available by default for most Linux distributions, there are still some distribution plans that have not yet included them.
Also affected is GTK+. This cross-platform toolkit exists as a functional component and API and is released as free software through the GNU Project. It is included in a variety of common projects, from the Apache OpenOffice office software suite to the Inkscape vector graphics editor to the PyShare image upload tool.
According to this Java proposal, an alternative to GTK 2 and 3 is to adjust Java graphics to ensure that it only supports GTK 3, which will greatly reduce the need for porting and testing. However, this solution may bring a large number of bugs that cannot be discovered through testing, which means that we need to invest extra effort in checking the appearance and use experience of AWT, and require porting one or both of JavaFX/Swing. The implementation of this type of migration often requires a lot of coordination between AWT and Swing.
However, a former Java manager who once worked at Sun Microssytems questioned the improvement effect this brought to Java. "There are not many Java-based desktop applications on the Linux platform, so I'm not sure how big the market is," said Arun, a former member of the Java EE team at Sun Microsystems and now vice president of developer evangelism at Couchbase. Gupta emphasized.
The above introduces a Java enhancement proposal released by the openjdknet website, including relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.