So l just started learning Java FX and l tried to create a file.
I have Java SDK
I downloaded the Java FX SDK and l imported it to global libraries. I even imported it to project libraries.
I did the VM option --module-path
C:\Users\admin\Desktop\Coding\javafx-sdk-11.0.2\lib
--add-modules=javafx.controls,javafx.fxml
Here is how my project looks.
Nothing fixed my problem. I tried with the newest Java FX SDK but it too didn't fix it. I tried importing from the .rar, l tried importing from a folder, l tried different VM module options, watched multiple tutorials and read multiple stackoverflow posts but nothing helped...
Nevermind l fixed it! I tried again with the newest FX SDK and l needed to only import it in project library not in global library!
Related
I have downloaded the most recent Apache poi from https://poi.apache.org/download.html and installed the jars into NetBeans by right-clicking libraries and selecting all the jars, and those in lib.
I'm then presented with these errors when trying to import and use poi in my project.
I have had a long look around and cannot find where I am going wrong here. Please could anyone point me in the right direction?
The error message indicates that the package org/apache/poi/xssf/usermodel is missing. The package is in poi-ooxml-5.2.2.jar, which should be added your library, as shown in How to use .jar files in NetBeans?. You can find other missing packages using the jar command, for example:
jar tf poi-bin-5.2.2/poi-ooxml-5.2.2.jar
Because not all of the JARs are needed for every document file format, see also Apache POI—Component Overview: Component Map and Apache POI: FAQ, item 3.
For reference, here's typical set of dependencies:
$ ls -1 dist/lib/
commons-codec-1.15.jar
commons-collections4-4.4.jar
commons-compress-1.21.jar
commons-io-2.11.0.jar
commons-logging-1.2.jar
commons-math3-3.6.1.jar
log4j-api-2.17.2.jar
poi-5.2.2.jar
poi-ooxml-5.2.2.jar
poi-ooxml-lite-5.2.2.jar
xmlbeans-5.0.3.jar
I want to update one library to use Swift Package Manager. Currently, it based on Carthage/Pods. But it uses libxml2 (#import ) as dependency. I have tried to add spm support but got an error this framework could not be found -> libxml/xmlreader.h
I also found some thread https://forums.swift.org/t/referring-to-libxml2-in-swift-package-description/28880/5
but seems still there is no solution. Would be great if someone can help.
I'm happy to say that this issue has now been fixed as of Xcode 11. All you need to do is import libxml2 just as you would any other module from the SDK such as Foundation or UIKit -- no additional search paths or configuration are needed.
For C targets you can also change the import style from #import <libxml2/libxml/.h> to just #import <libxml/.h> for compatibility with the more common header layout on Linux.
I'm new in Apache Netbeans 11 with JDK11, however i've been programming in jdk1.8 (netbeans 8.2) for a while but for school purposes i'm forced to use jdk11 this year, the problem is that I dont know, how to create new JavaFX FXML project. I've done some research and found out, that jfx is not a part of standard jdk anymore.
Then I found some tutorials how to run a javafx 11 project with adding the libraries, however it doesn't tell how to create a new project.
Is there any simple way how to add JavaFX 11 to my netbeans so the netbeans can use JavaFX 11 natively (I mean for example create new JavaFX 11 project with jdk11)
And if there isn't and I will have to use jdk 1.8, do I also need to install older Scene Builder or the SB11 will do the work (even for older javafx/jdk?
Ok, SOLVED:
As you can read in https://openjfx.io/openjfx-docs/#IDE-NetBeans OpenJFK docs, there are basicly many options to create openJFX project (either with FXML)
From IDE: That means that you have to add libraries, VM options, etc yourself for each project (As I mentioned in my question, not much user friendly solution I was looking for)
Create Maven Project
Create Gradle Project
I chose the Maven, yet I have had an errors telling me Unrecognized option: --module-path Command execution failed., altho I have had java_home set up on jdk11 and project on jdk11 as well. However, i needed to add system enviromental variable %JAVA_HOME% with jdk with higher priority then the old one. After that it still didnt run! BUT... Then I deleted the old system EV refferencing on jdk1.8. Since then the project runs with no errors. I tried to create EV refferencing the old jdk1.8 at the end of that Path list and it still run. (So there was a bug with prioritising the Paths I guess) Thank you all, espcly #JoséPereda
Sum – all steps I've done to solve Unrecognized option: --module-path Command execution failed.
Set Apache NetBeans etc/netbeans.conf -> netbeans_jdkhome=/path/to/jdk-11
Create a new System Enviromental Variable called JAVA_HOME with value of path to new jdk (jdk11 in my case)
Edit System Enviromental Variable Path -> New -> %JAVA_HOME%\bin and move it above your old jdk path (yet my Maven project didn't run after this step)
Remove the old jdk path (jdk1.8 in my case)
Restart Apache NetBeans 11 -> Run Project -> It runs with no erros
I tried to add my old System Enviromental Varible Path (refferencing jdk1.8) and it still works.
I am running XUbuntu x64 14.04.4 LTS on my PC, with eclipse Mars.2 Release (4.5.2) and JDK 8 properly linked up to my eclipse (via ini file).
So basically, I "upgradet" to e(fx)clipse. Then I crated a new "JavaFX project". When I tried to run it, I got the error The import javafx.application cannot be resolved.
A quick google search brought up, that I need to add the jfxwt.jar from my java 1.8 directory (in my case /opt/Oracle_Java/jdk1.8.0_91/jre/lib/).
But the error didn't went away. I also tried the build options but nothing seemed to change anything.
First of all, I included the wrong jar. whoops. thanks to #DVarga for the tip.
But that wasn't the problem. So here are all the steps I took, to create a working e(fx)clipse environment:
Download the latest eclipse version and add the e(fx)clipse package.
Update to the latest JDK and reference that in the eclipse.ini file (1)
Tell ecplipse the path for the latest JDK. Although this tutorial is for MACs, it works pretty much the same in linux. There are a few differences tho:
The preferences menu is in window > preferences
The JRE type is not MacOS X VM but rather Standard VM
The JRE home path is the jdk1.8.0_VERSION folder (in my case /opt/Oracle_Java/jdk1.8.0_91)
I didn't need to add any other jar for javaFX to work properly.
(1) How to add the Java 1.8 path to eclipse
if you get the error "JavaFX was disabled because your java version is to old" (or something like this) you need to update to at least Java 1.8 and edit the eclipse.ini file in the eclipse folder.
There you have to look for the line -vm. In the next line is a path to an old Java version. Change that to the new path. It should look like this: /path/to/jdk1.8.0_VERSION/jre/bin/ in my case it is /opt/Oracle_Java/jdk1.8.0_91/jre/bin/
I downloaded and installed JDK8u33 for ARM on my beaglebone black, and according to this documentation (http://docs.oracle.com/javase/8/embedded/jdk-arm-8u6/index.html) javafx is included and supported.
However, I can not find jfxrt.jar anywhere in the JRE or JDK, and using javac on a simple javafx program yields "javafx.application" is not a package.
What gives?
As #eckig says, since the 8u33 for ARM version, Oracle has removed JavaFX from the ARM distribution.
To run any JavaFX application you can downgrade your version to the last JDK8u6 that supported JavaFX, or you can provide a valid jfxrt.jar.
And you can do it following this tutorial, cross building OpenJFX for ARM, or just using some already built distribution like this one hosted on the JavaFXPorts project.
Once you have downloaded armv6hf-sdk.zip, unzip it and you need to add this command line option to attach this external source to the classpath, with the extension mechanism:
-Djava.ext.dirs=<path to armv6hf-sdk>/rt/lib/ext
For instance, you need this to run one of the JavaFX old samples from its actual path:
sudo /opt/jdk1.8.0_33/bin/java -Djava.ext.dirs=<path to armv6hf-sdk>/rt/lib/ext -jar BrickBreaker.jar
The latest version of the Java Development Kit for ARM processors (JDK 8u33 for ARM) no longer supports JavaFX Embedded, it has been all of the tech news, for example here: http://jaxenter.com/jdk-arm-without-javafx-end-javafx-embedded-114212.html