Netbeans 7.1.2 JavaFX UnsatisfiedLinkError - java

I've just upgraded my Netbeans to 7.1.2 as I thought I'd have a bash at some JavaFX development, however I'm not having a lot of fun.
First I downloaded the newest Netbeans and installed it, all fine.
Then Netbeans told me I didn't have JavaFX support, so I downloaded the jdk-7 from Oracle and the netbeans JavaFX plugin, and now I can create JavaFX applications.
However, whenever I try to compile a JavaFX app, I get the following error:
Error: failed to msvcr100.dll java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Java\JavaFX 2.1 Runtime\bin\msvcr100.dll: Can't find dependent libraries
Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Java\JavaFX 2.1 Runtime\bin\glass.dll: Can't find dependent libraries
Now both of these mentioned files exist, and they are in the locations mentioned, I'm assuming the problem is something to do with my classpath and/or the Sun/Oracle Netbeans previous installation I had.
I can't really be bothered to uninstall/reinstall all of my Java stuff, so I was wondering if anyone had any suggestions on how to fix this?
Some articles I've read have mentioned copying certain DLLs directly into the project workspace, but that doesn't sound right to me.
Any advice or suggestions would be greatly appreciated.
Thanks!!

Right-click your Netbeans project and click to "Properties". Navigate to "Libraries" and determine which "Java Platform" is used by the current project (which is selected one in the dropdown list). Click the "Manage Platforms..." nearby and select the determined Java platform. Go to JavaFX tab then check if the JavaFX is enabled and points to the correct SDK and Runtime paths in your file system.
Also consider restart the Netbeans or even Windows.

If you are using MacOS, even after install Java 7 the default SDK is still Java 6, despite the FX can be activated. Simply add JDK7 and it should fix the problem.

Related

How do I work with JavaFX in Eclipse Juno?

I have installed jdk1.7.0_15.
JavaFX's download page says the following:
JavaFX 2.2.7 contains the latest security fixes and is co-bundled with
the latest JDK 7 for Windows, Mac and Linux.
Download Java SE 7 with JavaFX 2.2.7
Like a good noob, I followed the instructions and installed the JDK. Now when I look for jfxrt.jar file that I can import to Eclipse as a user library, I can not find it. There are a few other JavaFX related libraries in JDK's lib folder but I do not understand what to import next.
Most of the tutorials on Google, including the one by Java, are very old.
Please help me get started with JavaFX
I recommend using e(fx)clipse.
e(fx)clipse is a plugin to assist JavaFX development in Eclipse which will fix your classpath issue and provide you with many other useful features as well as step by step documentation and code completion assistance.
Great question. I remember having the same problem when I started. Here is a little step by step guide.
1) Make a new JavaFx project (This is actually the same as a Java project, it just comes with a more suitable skeleton)
2) If you're getting errors like 'Can't find javafx.application' add the jfxrt.jar by right clicking on the libraries and select 'Add folder/Jar' You will have to browse to your jdk folder and find jfxrt.jar. Here is where it is located in my jdk:
/jdk1.7.0_15/jre/lib/jfxrt.jar
3) For the third step I suggest checking out this example. This example comes with sample code and I used it to copy and paste till I got a little more comfortable in javafx.

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.

Netbeans: Java module installed but can not create a Java project, why?

So I have been experiencing this problem for a while. I can use my existing java projects which I created on my PC, but on my laptop I can't create new Java projects. I reinstalled the program & reinstalled modules several times.
So when I click on new project, every java-type project is in the list except the regular one called 'java'... And the funny thing is that Java is the only project type I need at the moment, but it's simply not showing up..
I've looked on the internet for an answer but all I could find was one topic which was unanswered.
Help would be appreciated, a lot.
EDIT: OS: windows 7 64 bits. Using Netbeans 7.2 I think, well the newest for sure.
I just solved this problem by simply deleting .netbeans folder in User\<User>\ and .superId in \AppData\Roaming\NetBeans\
No need to reinstall.
Unfortunately you left out the OS you are using and you didn't mention the version of netbeans you tried!
You should completely uninstall netbeans. On UNIX OSes you'll find the .netbeans Folder in your homedir where netbeans keeps a lot of information. Remove this folder too (I don't know where this folder is stored on Windows OSes).
Having removed both netbeans and this folder, try a re-installation. Now things should look much better!
In my case I have installed multiple JDK (JDK version 8 and 9) due to which Netbeans 8.2 might not working as expected and then I was unable to create project.
Then I removed JDK9 and cleared cache from \Users\admin\AppData in windows.
Then I was able to create Java Project.

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.

Eclipse & web development

I'm trying to learn servlets and JSP and would like to do this with Eclipse. When I click about in my current version, I get this info:
Eclipse IDE for Java Developers
Version: Helios Service Release 2
After searching a bit, it seems you cannot access these features with this version - you need "Eclipse IDE for Java EE Developers".
I've found a tutorial to install these plugings in your Eclipse installation, but I'm just getting a "failed"-message with no error message. After this, I decided to just download a new version (the EE one ofcourse) from the Eclipse website. The old installation is in c:\program files (x86)\eclipse, the new one in c:\program files (x86)\eclipse2.
The old one still works fine, but when I try to run the new one, I get this:
I have no clue what is wrong here. Am I doing something wrong? The only thing I want is to use Eclipse for JSP and Servlet Development (soon also EJB).
Thanks
Eclipse cannot find your JRE/JDK. Put the JRE/JDK folder in your PATH variable. My JDK is located here:
C:\Program Files\Java\jdk1.6.0_24
Should be a similar path for you. Add that to your PATH variable.
Have look at this tutorial to find out how.
Make sure a Java 6 JDK is installed. If it is then you should be able to type javac -v on a command prompt and see output like this 'javac 1.6.0_26'
Once you have this correctly eclipse should start with no issues.

Categories