Unable to build JavaFX Application - java

I just install openJDK 8 (1.8.0_191) and realized that it does not include JavaFX, so I searched on some SO posts and found openJFX.
After installing it, everything worked well. I was able to create and run my JavaFX applications.
The problem is that when I try to build my JavaFX app, it throws some crazy Exceptions.
The build completes successfully if it is not a JavaFX app. Here is a screenshot of part of the stack trace.
I'm using Netbeans 8.2 as my IDE

In the files tab of your project you need to find the project.properties file. There you should search for java.fx.deploy.includeDT=TRUE, set this value to False.
See this: http://hongouru.blogspot.com/2015/09/solved-error-building-new-project-using.html

Related

intellij run button is greyed out any fix

I have been having issues when i'm trying to run a skew t plotting project i downloaded from github but when i opened the project in intellij i can't run anything and i have tried to edit the configuration but no luck and i keep getting this error when i open the fxml file that is in the project and the error shows the javafx runtime is not configured either use a JDK that has javafx built in or add a javafx library to the path and i tried javafx sdk version 18 but it kept giving me a not a valid home error
I believe JSF was removed from the JDK in version 11 and newer
You should add it as a JAR dependency to your project. Should be easy to do if you use Maven.

Vaadin 8 to 14 migration: .cache.js file not found when running in eclipse

I am currently trying to migrate a Vaadin 8 gradle project to Vaadin 14. When I package the project for production, it works fine, and the Vaadin app runs. When I attempt to run the project in eclipse, I get the following error:
Loading failed for the <script> with source “http://localhost:31415/VAADIN/static/client/client-4C23589935A74206212F474A719FC41C.cache.js”.
I saw a lot of other posts with similar questions, but none had a sufficient resolution. Nothing I have tried so far from Vaadin forums or github has worked.
Edit: I think I figured out part of the problem. For some reason, jetty is looking for the VAADIN folder in the bin directory within my eclipse project. It should first be looking in the classpath. This works in the compiled production version, but not in the development version of my project

Deploying a NetBeans application with JavaFX

I am attempting to build an application in NetBeans that can be deployed to and end user. I am still pretty new to deploying projects and this is by far the most complicated one I have done so please bear with me. I currently have a working application in NetBeans which utilizes JDK 15 and JavaFX 15. As long as I run things inside of NetBeans everything works as intended. I have reached a point where I want to make sure I can distribute this application outside of NetBeans. To this end I did some searching and found the following tutorial.
https://netbeans.org/kb/articles/javase-deploy.html
I was able to follow the tutorial and build the example. The build works in NetBeans, I am able to run the executable jar file in the dist folder from the command line, and I am able to run the jar file by executing it from the file explorer. Now when I attempt to do the same process with my own project I run into the following errors.
When I attempt to run the jar file in the dist folder absolutely nothing happens.
When I attempt to run the jar file from the command line using the command
java -jar "C:\Workspace\HandyAndyVersion1_2\dist\HandyAndyVersion1_2.jar"
I receive the following error,
Error: JavaFX runtime components are missing, and are required to run this application.
I am currently under the assumption that the first problem is a by product of the second. If anybody has a solution to this problem or any ideas on what I could have configured wrong please let me know and thank you all in advance.
To package a Java desktop application these days, you should be using the jpackage tool and optionally the jlink tool. These will generate a JRE image that is packaged with the application and contains the modules you need.
I suspect the issue you are running into is that the native libraries for JavaFX are not present. Most distributions of JDK 15 do not contain the JavaFX modules, though some do. (See the Full and FX bundles of the JDK from Azul and Bellsoft). I find it is easier to use a JDK with JavaFX bundled rather than have to manage a separate module path during development for the jmod files of JavaFX, but that is another option. Either method can be used with jlink to create a suitable JRE for your application that includes the JavaFX modules.

JavaFX on Android - Gradle can't find JDK

I'm trying to get JavaFX applications to run on Android by using the Dalvik JavaFX-Android SDK (provided by the JavaFX Android porting team). So I downloaded the samples provided by the JavaFX Android porting team and have been trying to run one of them on Android without much success.
Using Eclipse with the Gradle plugin I imported the "HelloWorldFxml" sample project. Then I ran the Gradle task "./gradlew androidInstall" on the project like the README file told me. But unfortunately the task cannot execute because Gradle cannot locate my JDK:
(source: forumbilder.se)
Even though my JAVA_HOME system variable is correctly set and I havn't had a problem with it before:
(source: forumbilder.se)
Anyone that can provide some insight as to how I can fix this?
Versions: Eclipse Luna Service Release 1a (4.4.1), Gradle 2.2, dalvik-sdk-8u40-ea3, Android SDK Build-tools 21.1.2, Android SDK Tools 24.0.2
Edit: The console output when running "gradlew androidinstall" on a sample project:
Even though the error message doesn't specify it, maybe it's looking for javac in your PATH? In case it's not in there try adding ;%JAVA_HOME%\bin to the end of your PATH variable (and restart Eclipse afterwards, I've had the problem of running processes not getting changes to environment variables before).
Check the Java setting in Eclipse:
Window -> Preferences
Java -> Installed JREs
Make sure that your JDK 1.8 is listed there. If it's not, add it using the Add... button.
Once the JDK is known to Eclipse, make sure that your project's settings use that JDK as a compiler, and the Gradle plugin should be able to pick up the setting from there.
In a pinch, you should also be able to run Gradle from the command line, and it should work fine since you already set the %JAVA_HOME% variable.
Basic Note
Since the release of dalvik-sdk-8u40-ea3, and in very short time, the JavaFXPorts team has released a few new versions, all of them simplifying all the process of porting a JavaFX application to Android or iOS.
They released dalvik-sdk-8u40-ea4 and they announced the release of a new plugin, that will simplify to the minimum the steps to create a mobile application from JavaFX.
While this answer may not help the OP in his particular problem, definitely it will help him and others, since everything is really simplified.
New approach
With this plugin, there's a new way of creating the HelloWorldFxml application for Android.
The new javafxmobile-plugin allows you to generate the apk with a single 'build.gradle' file.
You can find this an other basic samples here, and download the repository here.
You won't need to edit a single line, just type this on the command line, on the root of the sample, with your device connected:
gradlew androidInstall
As for previous releases, you will need JDK8u40 and Android SDK installed. No need for dalvik-sdk though, it's retrieved by the plugin.
Notice that you can open these samples from your IDE, so you will be able to modify them, and run them locally or build again the apk for your device.
Had this problem, too.
My proberties:
-Windows 7
-Dalvik SDK (dalvik-sdk-8u60-b5)
-JDK 8 (newest Version 8_60 / IMPORTANT: JDK not JRE)
-And I tried also the HelloAndroid project provided by the Dalvik-SDK-download.
So i execute the command line: gradlew installDebug
My probelm was nearly the same.
"Fail to find JDK. Please make sure there is a JAVA_HOME or JAVA8_HOME systemvariable."
#1
Created these proberties. Just like described in this post:
How to set java_home on Windows 7?
So to make everything sure, I created both with the same path. Cause I don't know exactly which one is used by gradle.
#2
This is really the hack that helps me out. Found this also in StackOverflow.
Write in your build.gradle under the android{..} stuff this line:
retrolambda {
jdk 'C:/Program Files/Java/jdk1.8.0_60' //<--your JDK-path
}
it looks like that
Then execute the same command line again and it worked for me.
I think only the 2. steps was the solution, cause I guess gradle don't look for the variable if there is a direct path to the jdk.

Can't deploy vaadin project

i have a little vaadin project for a school project that originally deployed well and worked.
i am using jboss as 7.1.1, vaadin7 and jdk8. My target platform is a raspberry pi running raspbian os.
so i am using the pi4j library to access the gpio interface of the raspberry and everything worked just fine until i implemented a check for null when creating a new instance of the web page. at first the error was because somehow the "jboss/standalone/deployments/roboterarm.war/WEB-INF/..../classes" directory became empty. afterwards the error came to eclipse as i could not use the pi4j library anymore. i did not touch the libraries and i can't figure out why it suddenly stopped working. i reinstalled eclipse, jboss and redownloaded all the libraries but i still can not use anything, not even in normal java applications!
afterwards i grabbed a copy from SVN that used to work normally but no luck there either, i can not use the pi4j jar-files.
everything looks fine to me there, yet it fails to give me code completion or compilation
i also tried creating a new vaadin project and c&p'ing the source code into the new project but the jar files are not recognized there either.
What am i doing wrong? how can i fix this? thanks in advance!
Eclipse buildpath, clearly indicates that your JRE is not properly added. Add your JRE to your build path, using the option Add Library.

Categories

Resources