JavaFX license - is including javaFX jar on your app server not breaching the license? [duplicate] - jar

This question already has an answer here:
May JavaFX 2.0 be redistributed? [closed]
(1 answer)
Closed 7 years ago.
So I've got an application which starts via Java WebStart. It requires javafx jar to work properly. If I place the javaFX jar on my server (so that it could be downloaded when starting the application) would it be ok with the license?

I'm not sure about the license (it should be possibe to provide native bundles which include the jre + javafx), but for Java WebStart the recommended way is to install the latest JRE on client-side, which comes with JavaFX. So you don't need the javafx jar on the server.
You should include the JavaFX start classes in the main jar, however, and have the correct JavaFX Manifest entries. But since the JavaFX Ant task provided by Oracle is copying these start classes to the main jar, I guess it's ok to use them. But I'm not a lawyer.

Related

How can a JavaFX application correctly handle opening of associated files on Windows in Java 1.8

This is a more specific version of the question I already asked on stackoverflow (How can I access a correct version of a Java Desktop class).
I will reiterate here the problem, and clarify the question:
I have a JavaFX application that can be used to edit files of a particular type on Windows OS. By using launch4j-maven-plugin I can make an exe file, and by using Inno Setup I can make an installer of this application that has a particular file type associated to it (kb files). If I install the application and double click on the file that this application is associated to while the application is not open already, the application opens and I can read the said file (I read main function args and use the filename to read the file). The problem I have is if the user tries to double click the file that this application is associated to, while the application is running. That does not work.
The question is: is there a way in Java 1.8 to respond to the event of double clicking the associated files for a JavaFX application ?
As already mentioned in the previous question, I tried using the Desktop class, but as I found out in the answer to that question, Desktop class has the methods to deal with this problem only starting from Java version 9.
However, we cannot update Java to version 9 or higher, since that would require huge re-engineering effort on our side.

How to call karate features present in a dependency JAR from another karate feature file? [duplicate]

This question already has an answer here:
How to distribute Karate testing framework? [closed]
(1 answer)
Closed 1 year ago.
I would like to re-use karate feature file present in a JAR (added as dependency to the working maven java project).
In the documentation at https://github.com/intuit/karate#karate-basejs, I can see the following :
Advanced users who build frameworks on top of Karate have the option to supply a karate-base.js file that Karate will look for on the classpath:. This is useful when you ship a JAR file containing re-usable features and JavaScript / Java code and want to 'default' a few variables that teams can 'inherit' from
But I do not understand how can I achieve this. Is it possible to share any example where the karate features present in a dependency JAR are called from a karate feature file
There is only one rule you need to be aware of. If a file exists on the Java classpath, Karate can read it if you use a classpath: prefix. This is explained in detail in the documentation: https://github.com/intuit/karate#reading-files - and you can find links to examples there.
So how you create a JAR file and how you add that to the classpath is up to you and has nothing to do with Karate.

JavaFX is NOT part of the JDK 14 [duplicate]

This question already has answers here:
IntelliJ can't recognize JavaFX 11 with OpenJDK 11
(7 answers)
Closed 2 years ago.
Oracle has clearly stated:
"As of JDK 7u6 JavaFX is included with the standard JDK and JRE bundles."
Currently I have JDK 14 on my desktop computer; I search the entire system to find such a file as jfxrt.jar; but nothing found. Also System.getProperty("javafx.runtime.version") returns null.
Additionally, I installed JavaFX SDK from OpenJfx and took a look inside its lib directory. The following are the only thing I found (nothing for run time; no jfxrt.jar):
Where can I download jfxrt.jar then?
JavaFX was removed from JDK since JDK 11.
Since JDK 9, java is modular.
JavaFX was split into modules.
Hence there is no longer a single jfxrt.jar file. There are several JAR files, one for each module.

How to add javafx environment variable in Ubuntu now that the Oracle removed javafx from JDK?

I recently started learning javafx but now I came to know it was removed from the core JDK since java 11. I can't seem to find a way to compile javafx application. The import declaration is not working (I am using MVC design pattern). Is there a way to get around this?
I am using VS Code
Starting with Java 9, JavaFX was moved out of the JDK so that updates to JavaFX did not have to wait on the next JDK release (at least that's what I remember). When Ubuntu switched to JDK 11 from JDK 8, they added a new package "openjfx" that provides the JavaFX libraries.
So you have a couple of options to use JavaFX.
Install OpenJFX
sudo apt install openjfx libopenjfx-java
Setup Gradle Build
If you are using gradle to build, you can set it up to download whatever JavaFX version you want. Follow the instructions from openjfx for setting up a basic gradle configuration. The linked page has an example file you can start with.
You may also want to consider using Intellij Idea Community edition IDE instead of VS Code. I think VS Code is excellent and have used it for a couple of years now including for JavaFX development. I recently switched to Intellij and the features it provides for java development are step above VS Code. Plus it's provided as a snap so easy to install:
snap install intellij-idea-community --classic
So, about the environment variable. I'm guessing you are on Linux, so you have two ways of setting it:
A) set it for current session;
B) set it globally.
Option A: open the Terminal and execute export PATH_TO_FX=[absolute path to Javafx folder]/lib. This will create a variable for your current user for the current session only - you will have to execute it every time you boot your OS.
Option B: locate the file /etc/profile; then back it up; then open it for editing and add the export PATH_TO_FX="[absolute path to Javafx folder]/lib" line to the end of it. Save the file and restart your system. This way the variable will be preserved for all users permanently.
Finally, test the Javafx presence by launching your application jar - java -jar --module-path $PATH_TO_FX --add-modules javafx.controls,javafx.fxml your.jar (or launch your main class as shown in the documentation).

Java 8 update 121 missing JavaFX Dialog and Alert classes?

I'm developing a JavaFX application and can't seem to import the Alert and Dialog classes that were released with Java 8 update 40 (Java 1.8.0_40). My version of Java is the newest version (1.8.0_121-b13). Did they remove Alert and Dialog from the latest version? How do I even find what classes are included in a specific Java release?
Here is my attempt to import:
import javafx.scene.control.Dialog;
It is okay up to the package control but cannot find the class Dialog.
Other information
Using Netbeans as my IDE
Project Properties:
Sources >> Source/Binary Format: JDK8
Sources >> Profile: Full JRE
Libraries >> Java Platform: JDK 1.8 (Default)
Thanks to James_D for helping me determine that I did actually have the classes on my hard disk (see the comments section of the original question). I then knew it was just a matter of configuring Netbeans properly. (Programming is not my main job so spending time trying to learn what all the settings & menus mean in the IDE is quite overwhelming right now, though I am learning bit by bit).
Anyway, I found what I needed under the menu:
Tools >> Java Platforms
Even though I have the latest JDK installed, this was still pointing to jdk1.8.0_20 which is pre-JavaFX Alert & Dialog classes.
Adding a new Java Platform and then going into Project Properties and setting it there fixed my issue.

Resources