May I deploy jfxrt.jar with my application (techni

2019-09-06 11:08发布

问题:

Is jfxrt.jar pure java? How this can be proved? May I deploy jfxrt.jar with my application and will it work with any version of JRE?

Won't it interfere with jfxrt.jar in installed JRE?

What if my app will run under Java8 where javafx is integrated more tight?

UPDATE

I don't understand what does "not pure Java" mean? If jar loads and uses native libraries, then it is not pure by definition? Am not I right?

回答1:

May be someone from Oracle would give a better answer to this question. As far as I know :

  1. yes jfxrt.jar is pure java, never heard of a jar not being pure java pun intended

  2. Yes you may deploy your application with jfxrt.jar

  3. Will it run with any JRE - NO, because javafx is built using java and AFAIK, javafx uses minimum java 7 (not sure about the update version). So, you must atleast have JRE 7 on the system.

  4. Won't it interfere with jfxrt.jar in installed JRE - It may, as it does for any other jar !

  5. What if my app will run under Java8 where javafx is integrated more tight - Doesn't makes sense. I am not able to get the question !



回答2:

  1. The jar is pure Java but it loads native libraries from the JRE/lib directory. So shipping jfxrt.jar with your applications has high chances that there is a mismatch between the native libraries and their Java counter parts
  2. jfxrt.jar is part of OpenJDK so you can ship it under terms of OpenJDK
  3. The Oracle adivsed option is to package the JRE with your application using their packageing tools and don't depend on a System-JRE