B4J Question Check if JavaFX is installed

Blueforcer

Active Member
Licensed User
is it poosible to check if javaFX is installed?
I have a class wich seems to need JavaFX, but many users doesnt run JavaFX on their systems, so i need to stop loading this class

thanks
 

GMan

Well-Known Member
Licensed User
With this code
B4X:
Sub getSystemProperties
    ' Declare the JavaObject and init the class
    Dim JO As JavaObject
    JO.InitializeStatic("java.lang.System")
    ' Get the system properties into one object
    Dim objProperties As Object = JO.RunMethod("getProperties", Null)
    ' Convert the properties object into a list of strings
    Dim s As String = objProperties
    s.SubString(1)
    Dim l As List
    l = Regex.Split(", ", s)
    l.Sort(True)
    ' List the properties
    For i = 0 To l.Size - 1
        Log(l.Get(i))
    Next
End Sub
i read out some system Properties, also the actual JavaVersion.
Maybe you can use this to check if and if yes, what version i installed

Here is the line from the Log:
javafx.runtime.version=8.0.66-b33
 
Top