1

Does anyone know of a way to run a legacy program written in JavaFX 1.3 script language in a current Java 8 runtime? My guess is there are "simply" some class name conflicts now that JavaFX is included in the JRE.

My program gives up with one of the following exceptions (there will probably be more if I dig deeper):

  • (When instantiating a Node extended from CustomNode):

    java.lang.VerifyError: Cannot inherit from final class
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at ......Main.initializeNodes(Main.fx:313)
    
  • (When instantiating a Group):

    java.lang.NoSuchMethodError: javafx.scene.Group.<init>(Z)V
        at ......Main$Main$Script.applyDefaults$(Main.fx:131)
        at com.sun.javafx.runtime.FXBase.applyDefaults$(FXBase.java:307)
        at ......Main.<clinit>(Main.fx:7)
    
  • (When creating certain nodes):

    java.lang.NoSuchMethodError: javafx.scene.CustomNode.VCNT$()I
        at ......SomeNode$SomeNode$Script.VCNT$(SomeNode.fx)
        at ......SomeNode$SomeNode$Script.count$(SomeNode.fx)
        at com.sun.javafx.runtime.FXBase.<init>(FXBase.java:274)
        at ......SomeNode$SomeNode$Script.<init>(SomeNode.fx)
        at ......SomeNode.<clinit>(SomeNode.fx)
    

Migration to JavaFx8 or another technology is unfortunately not an option.

The only workaround I know of so far is using JRE < 8.

Holger
  • 285,553
  • 42
  • 434
  • 765
kmc
  • 11
  • 3
  • I advise either you run your JavaFX 1.3 on a Java runtime for which JavaFX 1.3 was qualified (e.g. Java 6), or, preferably, migrate to JavaFX 8+ or another technology. – jewelsea Nov 16 '15 at 18:46
  • One other thing you could try is a [server Java 8 JRE which Oracle provides](http://www.oracle.com/technetwork/java/javase/downloads/index.html). A server JRE will not contain any JavaFX 8 runtime classes or native code that could conflict with your JavaFX 1.3 installation. I would still be a bit skeptical that you would be able to get such a hybrid installation to work, but perhaps it is worth a try for you. – jewelsea Nov 16 '15 at 18:48
  • Yes, I didn't think of that. With a server JRE it indeed seems to work without a problem, so I would accept this as a correct answer. I just failed to mention that in this unfortunate case I have limited control over the installed JRE, and also, even if I can replace the user's JRE, I would need a 32-bit JRE (for Windows), and Oracle only provides 64-bit versions of the server JRE. Are there any alternatives? (I found some unofficial builds of OpenJDK for Windows, but it seems a very "rocky road" to go...) – kmc Nov 18 '15 at 11:28

1 Answers1

0

There is the Visage project which wanted to continue support for JavaFX script, if I remember correctly. I don't know the status of the project.

I know you mentioned migration to JavaFX 8 is not an option, but it's still the thing I recommend.

Puce
  • 37,247
  • 13
  • 80
  • 152
  • Thank you for your suggestion. Unfortunately Visage seems to be very inactive now, and last time I checked it was far from complete in terms of covering all the features / gui elements of JavaFX 1.3, and also required efforts which could be equated with a "migration". Maybe still worth a try if I had the time... – kmc Nov 18 '15 at 11:53