• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

NetBeans + JavaFX Compile error

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

I hope this is the right place for my (maybe a very beginner) question.

I'm about to learn JavaFX and therefore wanted to try out the samples provided by NetBeans.

But when I compile one of the JavaFX samples, I get following errors and warnings



as well as




For compiling the project, I had to add a new "platform" for JDK 1.8 in netbeans, because in JDK 1.7 JavaFX is not included. Netbeans-Screenshots can be seen here



But I can compile and build projects with JDK 7 - but then I can't use JavaFX of course.

It seems that there is a version conflict with JDK?! But as I'm completely new to Netbeans, I wasnt able to find how to fix it

This is my system: I'm using NetBeans 8.0.1 on Linux Mint 17, "java -version" tells me

java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)

I have also checked "which java", "whereis java" which points to the right location, where I installed the JDK 8 stuff (it prompts "/usr/bin/java -> /etc/alternatives/java" and "/etc/alternatives/java -> /usr/local/java/jdk1.8.0_11/bin/java").

I hope you have any suggestions for me!

Thanks in advance,

Juergen

 
author & internet detective
Posts: 39435
768
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Juergen,
Welcome to CodeRanch!

That error message means that the code was compiled with Java 8 and is being run with an older version of Java. Your screenshot says Java 7 is the default for you workspace. Maybe change it to 8?
 
Jürgen Drachta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply!!

It works now!
You are right, I had to remove JDK 7 from the platforms.
To help others which maybe encounter this issue: This can be done, by starting netbeans with the parameter "--jdkhome /path/to/JDK" (or by modifying the netbeans.conf).

It's a little bit embarassing, that I didn't try this out before. The reason was, that in the project properties the Runtime platform was set to "Project Platform", which I assumed to be the building platform.
Apparently it is not Or it's a little bit buggy xD

Thank you again for your answer!!
 
I am a man of mystery. Mostly because of this tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!