jfxrt.jar not in JDK 1.8? - java

I just updated my JDK to the JDK 1.8 because i couldnt find the jfxrt.jar needed by java FX in the 1.7 version.
I downloaded the JDK from here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Specifically the version:
jdk-8u5-linux-i586.rpm
I use opensuse 13.1 by the way.
Now after the installation my usr/java/jdk1.9_05/lib still does not contain the jfxrt.jar.
Has anybody an idea why, I read that this version should actually contain it. Can I fix this problem putting the jar in ther manually?

For me on OSX it's under jdk1.8.0_05.jdk/Contents/Home/jre/lib/ext/jfxrt.jar. I'd guess it's in an analogous place on your machine. Try /usr/java/jdk1.8.0_05/jre/lib/ext/jfxrt.jar

Am using linuxmint 18.1 and i had the same issue. i realized that the open jdk i had didn't have the jfxrt.jar library.
Download another jdk from oracle and then install it. Remember to change the path in the netbeans.conf file in the netbeans installation folder.

From the above comments, i tried this.
I added jfxrt.jar(Downloaded JDK) to PC.
In eclipse, right click project --> properties --> Libraries --> Add external jar and choose the jar file.
The error went away.

You have to add requires jfxrt; to your module-info if you have trouble after adding jfxrt.jar

Related

Cannot add java 11 jre in STS version 4.5.0

I am trying to migrate my Springboot projects from Java 8 to Java 11 although I'm having issues first on updating the installed jre of my STS. Since java 11 doesn't have any separate jre, unlike the previous versions, I was trying to include the jdk 11. Although as you can see on the bottom photo, it does not seem to locate the jrt-fs.jar file.
I've also tried to configure the SpringToolSuite4.ini file by including these lines:
-vm
C:\Program Files\Java\jdk-11.0.7\bin\javaw.exe
This is how my .ini file looks like:
Although nothing still happens. Anyone who has other pieces of advice on where I should check? Thank you in advance!
In the preference for configuring the JREs you should select the JDK folder itself, not the lib nor the bin folder. Eclipse will find all the necessary files and libraries that are included in that JDK and can deal with JDKs >= 11.
Please note that this preference is different from the VM that you specify in your ini file. The VM in the ini file is used to run the IDE itself, not to compile your projects against or run them. It is a totally separate thing, which allows you to run your IDE on JDK11 (for example), whereas at the same time you can implement and run projects on JDK8 or JDK14 (or whatever).
You are adding the lib/ dir instead of bin/.
Don't forget to add bin/ to the %Path% environment variable.
Make sure you don't have duplicates from earlier versions of the jdk/jre.
Sorry, you are adding the jdk instead of the jre that is expected:
https://www.java.com/de/download/help/download_options.xml

The specified JDK folder doesnot contain JDK (NetBean IDE Installer)

This appears in netbeans IDE Installer,
what should I do here?
I had that issue when my JDK version was too far ahead of NetBeans. JDK 11 was a problem.
When I installed JDK 8.x, the NetBeans installation worked.
Also, note that the NetBeans installer requires the JRE in addition to the JDK, but doesn't mention this at first. (Again, I used JRE 8.x).
This error means, that you put invaild JDK directory. Maybe it happens becouse you are addin "\lib" at the end - try without this.
You need to find place, where JDK is installed. Try to use "where javac" or this code below:
C:> for %i in (javac.exe) do #echo. %~$PATH:i
Write this into cmd.exe, and then copy and paste this address in NetBeans (JDK for the Netbeans IDE).

Where to get the tools.jar to use with the Java 8 jdk early release

Where to get tools.jar for Java 8 JDK early release? Without it, my Java 1.8 Maven pom based projects in Netbeans will not compile.
The Java 8 early release is set in the Java Platforms setting and all the Java 8 projects that are not Maven-based will compile and run.
https://jdk8.java.net/download.html
It is not found on the downloads page, I can not find anything in their search.
Does anyone have success compiling Maven pom based projects with the Java 8 early release?
Can the old tools.jar be used or where did you find it?
The tools.jar file on the 1.8.0 JDK is located in jdk1.8.0/lib/tools.jar. If it's not there, then you don't have the JDK installed correctly.
Please see the accepted answer - the tools.jar file was omitted in a specific early access revision (jdk-8-ea-bin-b106-windows-i586-05_sep_2013.exe).
You just need to install devel package. On RHEL family it's like this:
# yum install java-1.8.0-openjdk-devel
I had a similar problem when using Hadoop-Common-2.7.2 as a dependency. I resolved the problem by adding the following exclusions to my POM.xml file:
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.7.2</version>
<exclusions>
<exclusion>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
</exclusions>
</dependency>
Some JDK packages contain just the Java Runtime Environment.
So for instance in Fedora, Oracle Linux, RHEL, CentOS java-1.8.0-openjdk package contains just the JRE. If you want the development tools, then install the java-1.8.0-openjdk-devel package instead.
And in Debian/Ubuntu openjdk-8-jre package contains just the JRE. If you want the development tools, then install the openjdk-8-jdk package instead.
You can download any version of the tools.jar file. For example, it is available from java2s.com. It would be preferable, though, to find it on the official Oracle site, if possible.
After downloading any version of the tools-x.x.jar file, simply rename it to tools.jar (removing the version number) and place it in the jrex.x/lib folder.
Answer on the behalf of question author:
This version is missing tools.jar:
jdk-8-ea-bin-b106-windows-i586-05_sep_2013.exe
It is now in the most recent release.
Make sure you look into the folder
C:/Program Files/Java/jdk1.8.0_version/lib
instead of
C:/Program Files (x86)/Java/jdk1.8.0_version/lib
The file tools.jar was removed in Java 9. Please see "Removed Tools and Components" on Oracle.com JDK 9 page here
I had a similar problem and found the solution in the Android Public Issue Tracker: tools.jar not packed in lib of Java JDK 8 and Android studio gives tools.jar missing error.
As kn...#gmail.com states in comment #8, the error appears only when the JDK is not installed in its default directory. The problem is resolved by reinstalling the JDK into its default directory.
Simply copy the tools.jar from your jdk\lib folder and paste into jre\lib folder.
The solution is to update the eclipse.ini file. If no JDK is used for Eclipse, change it:
Quit Eclipse if it is running
Go to the Eclipse installation directory and open the file eclipse.ini in a text editor
Search for the line -vmargs
Before the line -vmargs, add two lines:
On the first line, write -vm
On the second line, write the path to your JDK installation (usually something like: C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe on Windows)*
Solution also documented here
If using Reactive Native:
Install the latest JDK from here.
If the problem not solved then go back to react-native documentation about installing react native (android) on mac, here
In root of your reactnative project:
cd android
./gradlew clean
./gradlew assembleRelease
When I looked at Eclipse > Window > preference > Java > Installed JRE >, it was pointing to JRE, which seems obvious. However, when I changed it to point to JDK, the compile error was resolved. This is because there is tools.jar in the JDK folder.
Before this, I had tried copying tools.jar from jdk/lib to jre/lib. However, that did not solve the issue.

Download and install JavaFX for Eclipse

I'm an experienced (Java, Eclipse & Maven) developer, and have used a couple of frameworks thus far. Every time I'm trying to start with something new, it seems like there are about a zillion configuration possible for downloading and installing it.
I've looked here for instructions, and all the near pages, but they seem out dated, the Eclipse plugin path is invalid, and when I install the latest version I've found no the site (2.0.2), it says that I have a newer version installed.
Also, the Maven setup in most posts I've read seems obscure.
I'm using:
Windows 7
Eclipse x64 Indigo
JDK x64 1.6.0.24
Maven 3.0.3
And I don't recall installing the JavaFX.
What an I missing? Where can I read about the setup in order to start working with this framework?
JavaFX gets installed if you install the latest JDK 7 from Oracle (co-bundled).
You can find the Eclipse plugin here:
http://efxclipse.org/
If your're interested in Maven builds: I've recently released an initial version of Drombler FX, a modular RCP for JavaFX based on OSGi and Maven (POM-first):
http://puces-blog.blogspot.ch/2012/12/drombler-fx-building-modular-javafx.html
http://wiki.drombler.org/GettingStarted
I did tried efxclipse but it was not enough for me. I have also tried to give the path of javafx jar file to efxclipse
Window->Prefrences->javafx->"The path to javafx jar which is
jfxrt.jar"
. But nothing worked for me I don't know what was going wrong.
Then I just add the jfxrt.jar file to my Library and everything worked fine :-
1. Right click your JRE System Library
2. Build Path
3. Configure Build Path
4. Add External Jars
5. "The path to jfxrt.jar"
You can download jfxrt.jar file from this link.
Or
If you have already downloaded the latest oracle JAVA JDK you will find in this path
Extracted_oracle_jdk_folder/jre/lib/ext/jfxrt.jar
That's it everything should work fine.
Try e(fx)clipse at http://efxclipse.org/. I'm a netbeans developer, but heard a lot of good stuff about that plugin from my eclipse using friends.

Missing libraries with oracle-java7-jdk in eclipse on ubuntu 12.04

I recently installed the ubuntu 12.04 final beta
After installing the oracle jdk from the webupd8 ppa, launching eclipse failed complaining about a missing shared library.
Can't load library: /home/bob/.swt/lib/linux/x86_64/libswt-gtk-3740.so
I searched around, and found this quesion: Eclipse cannot load SWT libraries
As the OP recommended, I tried switching to open-jdk, and that worked wonderfully. The problem, however, is that I am working on a project that doesn't support openjdk.
I tried the second solution as well (the one by scott, which was just creating symbolic links to /usr/lib/jni/... in ~/.swt/lib/linux/x86_64/). Eclipse launches and everything is fine, but it still misses some libraries; this is what I get when i try to run my project:
Caused by: java.lang.UnsatisfiedLinkError: /tmp/libgdx/1352105074/libjogl_awt-linux64.so: libjawt.so: cannot open shared object file: No such file or directory
I know libjawt.so is somewhere on my computer:
$ locate libjawt.so
/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/libjawt.so
/usr/lib/jvm/java-7-oracle/jre/lib/amd64/libjawt.so
But eclipse or java seems to think that libraries should be placed in ~/.swt/lib/linux/x86_64, isn't that weird?
Eclipse when launched defaults to its own internal JRE, as I understand. I recommend the following:
Modify your CLASSPATH variable to include the path to the desired libraries;
Set your JAVA_HOME to match the actual JAVA_HOME;
Setup Eclipse to launch from the desired JVM by customizing the eclipse.ini using this information: http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#eclipse.ini
Also, can you specify the -classpath option when Eclipse is launched?
Try downloading the latest version of Eclipse and running it. For some reason it works fine. I just ditched my older version of Eclipse. I hope this works for others!
Please note that there are two Java runtimes in play here. The one used to run Eclipse itself, and the one you want to run your code. They do not have to be the same!
I would suggest
Run Eclipse with a JDK that works
Download Oracle JDK manually and unzip it to a folder in your home directory
Tell Eclipse about this additional runtime (http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-add_new_jre.htm)
Configure your project to use that JVM instead. (http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-assign_default_jre.htm)
Now your own code is compiled against, and runs with Oracle Java.

Categories