I am a bit confused. In Oracle jre 1.7, we have the package com.sun.webpane.webkit and in oracle JRE 1.8, we have com.sun.webkit (no webpane)
How are we supposed to handle such change so that an application works on both environment, any best practises ?
Thanks
You should not use com.sun
classes in your code. Such classes are not part of the public API which is supported by Oracle or the OpenJDK for the JDK and JavaFX. Oracle makes no guarantees that com.sun
classes will be backwards compatible between releases.
Oracle do guarantee that the public APIs, e.g., java.*
and javafx.*
will be backwards compatible between releases. So stick to using only supported public APIs in your code and your code should work much better across different Java releases.
For the particular control you are trying to utilize (the webkit implementation embedded in JavaFX), the public API for that is the javafx.scene.web.WebView
API.