Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » 11 errors on "New FX-Project"
11 errors on "New FX-Project" [message #1802480] Sun, 10 February 2019 12:49 Go to next message
Michael Lüssem is currently offline Michael LüssemFriend
Messages: 6
Registered: February 2019
Junior Member
Eclipse IDE for Java Developers
Version: 2018-12 (4.10.0)
Build id: 20181214-0600
OS: Mac OS X, v.10.13.6, x86_64 / cocoa
Java version: 11.0.1


Hi,

sorry, another newbie with really low skills, but I hope to get some help.

I have installed the e(fx)clipse-plugin from the marketplace. Starting a "New FX-Project" get 11 errors:
Description	Resource	Path	Location	Type
Application cannot be resolved to a type	Main.java	/test/src/application	line 9	Java Problem
BorderPane cannot be resolved to a type	Main.java	/test/src/application	line 13	Java Problem
BorderPane cannot be resolved to a type	Main.java	/test/src/application	line 13	Java Problem
Scene cannot be resolved to a type	Main.java	/test/src/application	line 14	Java Problem
Scene cannot be resolved to a type	Main.java	/test/src/application	line 14	Java Problem
Stage cannot be resolved to a type	Main.java	/test/src/application	line 11	Java Problem
The import javafx cannot be resolved	Main.java	/test/src/application	line 3	Java Problem
The import javafx cannot be resolved	Main.java	/test/src/application	line 4	Java Problem
The import javafx cannot be resolved	Main.java	/test/src/application	line 5	Java Problem
The import javafx cannot be resolved	Main.java	/test/src/application	line 6	Java Problem
The method launch(String[]) is undefined for the type Main	Main.java	/test/src/application	line 24	Java Problem


I think it is because:

import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;

How can I fix this issue?

Thank you for you support!

Michael - germany

Re: 11 errors on "New FX-Project" [message #1802543 is a reply to message #1802480] Mon, 11 February 2019 17:23 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
JavaFX is not part of JDK-11 you need to add it manually to your project! I think we also have to revise this wizard as it has to be a module-project!
Re: 11 errors on "New FX-Project" [message #1802557 is a reply to message #1802543] Mon, 11 February 2019 20:54 Go to previous messageGo to next message
Michael Lüssem is currently offline Michael LüssemFriend
Messages: 6
Registered: February 2019
Junior Member
Hi Thomas,

thank you for your response.

Trying tho solve the problem I found https://gluonhq.com/products/javafx/

I do not exactly understand what I have to do with the files in the SDK and the jmod-ZIP.

Quote:
The JavaFX 11 runtime is available as a platform-specific SDK, as a number of jmods, and as a set of artifacts in maven central.


I also tried this using Maven

<dependencies>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-controls</artifactId>
      <version>11.0.2</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <release>11</release>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>HelloFX</mainClass>
        </configuration>
      </plugin>
    </plugins>


It worked so far, that now I can import the following:

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;


BUT:

Error: JavaFX runtime components are missing, and are required to run this application

Hope to get your help one more time.

Thank you

P.S. Thomas Schindl hört sich irgendwie deutsch an, von mir aus auch gerne auf deutsch, das Ergbnis posten wir dann für alle wieder auf englisch
Re: 11 errors on "New FX-Project" [message #1802568 is a reply to message #1802557] Tue, 12 February 2019 05:07 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Well I'm Austrian but as this is a public forum we should stick to that language. Did you add a module-info.java? You require that because otherwise you are not running a modular java application. I just tried myself and if you add a module-info.java things work fine - see https://github.com/BestSolution-at/kitchensink-samples/tree/master/openjfx.m2e
Re: 11 errors on "New FX-Project" [message #1802610 is a reply to message #1802568] Tue, 12 February 2019 18:39 Go to previous messageGo to next message
Michael Lüssem is currently offline Michael LüssemFriend
Messages: 6
Registered: February 2019
Junior Member
Thomas,

you are great! This was really helpful. Now that I know what the error causes I just have to learn what the module-info.java-file is and what it does, but I hope I will find that with my good old friend google.

Thanks a lot and best greeting to austria - hope you will not get so much snow in the next weeks!

Michael
Re: 11 errors on "New FX-Project" [message #1803242 is a reply to message #1802568] Mon, 25 February 2019 16:34 Go to previous messageGo to next message
Michael Lüssem is currently offline Michael LüssemFriend
Messages: 6
Registered: February 2019
Junior Member
Hi Thomas,

hope you see this again.

I still worry about the correct using of the module-info.java. Each time I try to begin a new JavaFX-project, I instantly get an error, even if I did not code anything (see attached video).

What am I doing wrong? I installed the e(fx)clipse 3.4.1.-plugin by using the eclipse-marketplace.

In fact, your example-project Quote:
https://github.com/BestSolution-at/kitchensink-samples/tree/master/openjfx.m2e
was the only one which I can run.

Can you help me once more?

Thank you!

Michael
Re: 11 errors on "New FX-Project" [message #1804235 is a reply to message #1802480] Thu, 21 March 2019 03:32 Go to previous messageGo to next message
Andrew scott is currently offline Andrew scottFriend
Messages: 3
Registered: March 2019
Junior Member
I too am an Mac OS user with JDK 11 and am wanting create Java FX applications using Eclipse and am running into the same compilation/import problems with the HelloWorld application built by the wizard of my E(FX) v3.5.0 plug in in the most recent stable version of Eclipse.

I downloaded the open JDK 11 zip file from and have it in: /Library/Java/javafx-SDK-11.0.2//lib

But then what am I supposed to do from eclipse so that it knows about this JDK? I have tried going in to the project properties and adding javafx.fxml.jar and various others in to the build path but the provided code will still not compile.

What am I supposed to do with it and also, why is this process not properly or clearly documented?
Re: 11 errors on "New FX-Project" [message #1804282 is a reply to message #1804235] Thu, 21 March 2019 17:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Since OpenJFX is not shipped with any JDK anymore the best option to develop JavaFX-Applications is to:
* Download OpenJDK from jdk.java.net
* Download OpenJFX
* Create a gradle (you need to install buildship) or maven (you need to install m2e)
* Add the openjfx-modules via build.gradle/pom.xml

See https://openjfx.io/openjfx-docs/
Re: 11 errors on "New FX-Project" [message #1804293 is a reply to message #1804282] Fri, 22 March 2019 00:17 Go to previous messageGo to next message
Andrew scott is currently offline Andrew scottFriend
Messages: 3
Registered: March 2019
Junior Member
I really should not have to install Gradle just to build basic Java GUI applications. I have to suffer Gradle in Android and would like to stay away from it for vanilla Java applications. I really think this process needs to be simplified. In particular if Oracle are going to harm their eco system, then it falls on E(FX) to simply this without requiring things such as Gradle and Maven.

It really does feel like the support for JavaFX (in JDK 11)from all IDEs has taken a back seat so much so that I think for a language as prominent and important as Java, its quite an awful situation which will only drive people elsewhere. If E(fx) can simplify this, Eclipse will be at a clear advantage overt other IDEs as far as JavaFX goes and will only strengthen E(fx)s importants within the Eclipse EcoSystem.

[Updated on: Fri, 22 March 2019 00:28]

Report message to a moderator

Re: 11 errors on "New FX-Project" [message #1804313 is a reply to message #1804293] Fri, 22 March 2019 10:35 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Well as OpenJFX is now a library there's no other option than to download the library artifacts, or build a custom JDK-Distribution using jlink. I'm open for suggestions how to improve but in reality you need to be able to build a project headless on your CI system or at least your own command line. So for any none playground project you have to use gradle or maven.

Please open a ticket at and we can track there how to improve the situation for you https://github.com/eclipse-efx/efxclipse-eclipse I can not promise we'll be able to implement anything anytime soon
Re: 11 errors on "New FX-Project" [message #1810732 is a reply to message #1804313] Sun, 18 August 2019 11:04 Go to previous messageGo to next message
Bernhard Steppan is currently offline Bernhard SteppanFriend
Messages: 1
Registered: July 2009
Junior Member
I now have found the solution for the problem with Eclipse an JavaFX:

- E(fx)clipse is not required
- Install JavaFX, e.g. version 12
- Make a user library from this libs inside the JavaFX folder, e.g. JavaFX 12
- Make a new Java project and add the JavaFX 12 user library
- Create a new JFX application
- Run the application with a modified Eclipse run configuration:
Add the vm arguments:
--module-path /Users/bsteppan/ ... /javafx-sdk-12.0.1/lib --add-modules javafx.controls,javafx.fxml
and -- VERY IMPORT --
disable the check box: Use the -XstartOnFirstThread argument when launching with SWT

Hope this helps!

-Bernhard

[Updated on: Thu, 29 August 2019 04:12]

Report message to a moderator

Re: 11 errors on "New FX-Project" [message #1833691 is a reply to message #1802480] Wed, 21 October 2020 15:59 Go to previous message
Robert Van Cleave is currently offline Robert Van CleaveFriend
Messages: 6
Registered: February 2018
Junior Member
This is ridiculous! Why have to go through all these steps to get what was working fine before. I am a college instructor who has been recommending to my students to install Eclipse, but I cannot possibly require them to to go through all this hassle!

Next you will require us to put the eyes of a newt on our keyboard at midnight. Really!
Previous Topic:javaFX SDK Library not usable
Next Topic:Locate new JavaFx Project wizzard
Goto Forum:
  


Current Time: Sat Dec 21 16:57:42 GMT 2024

Powered by FUDForum. Page generated in 0.04249 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top