1

Fiz uma tela com o Scene Builder, porém quando vou compilar no JavaFX dá esse erro poderiam me ajudar?

    ant -f C:\\Users\\gusta\\Desktop\\TccProject\\LoginJAVAFXML jfxsa-run
init:
Deleting: C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\build\built-jar.properties
deps-jar:
Updating property file: C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\build\built-jar.properties
Copying 1 file to C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\build\classes
compile:
Deleting directory C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\lib
Copying 1 file to C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\lib
Detected JavaFX Ant API version 1.3
Launching <fx:jar> task from C:\Program Files\Java\jdk1.8.0_172\jre\..\lib\ant-javafx.jar
Warning: From JDK7u25 the Codebase manifest attribute should be used to restrict JAR repurposing.
         Please set manifest.custom.codebase property to override the current default non-secure value '*'.
Launching <fx:deploy> task from C:\Program Files\Java\jdk1.8.0_172\jre\..\lib\ant-javafx.jar
No base JDK. Package will use system JRE.
No base JDK. Package will use system JRE.
jfx-deployment-script:
jfx-deployment:
jar:
Copying 13 files to C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\run216776770
jfx-project-run:
Executing C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\run216776770\LoginJAVAFXML.jar using platform C:\Program Files\Java\jdk1.8.0_172\jre/bin/java
Exception in Application start method
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$154(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: Location is required.
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3207)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)
    at loginjavafxml.LoginJAVAFXML.start(LoginJAVAFXML.java:23)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
    ... 1 more
Exception running application loginjavafxml.LoginJAVAFXML
Java Result: 1
Deleting directory C:\Users\gusta\Desktop\TccProject\LoginJAVAFXML\dist\run216776770
jfxsa-run:
CONSTRUÍDO COM SUCESSO (tempo total: 5 segundos)

1 Resposta 1

1

Verifique em seu SceneBuilder se está referenciando sua classe Controller. Pode ser editado direto no FXML desta forma

fx:controller="sample.Controller"
9
  • Sim no meu FXML tem no codigo : <AnchorPane id="AnchorPane" prefHeight="500.0" prefWidth="800.0" style="-fx-background-color: #010A0A;" xmlns="javafx.com/javafx/8.0.141" xmlns:fx="javafx.com/fxml/1" fx:controller="loginjavafxml.FXMLDocumentController"> Commented 12/05/2018 às 23:17
  • Notei no erro ele exibindo "No base JDK. Package will use system JRE.", você fez a instalação do seu JDK? executou outros projetos nessa maquina? Commented 12/05/2018 às 23:28
  • Sim utilizo JDK versão 1.8 estou usando uma biblioteca JAR também que se chama JFoeniX github.com/jfoenixadmin/JFoenix inclusive baixei pro JDK8, sim fiz outros projetos já mas executei inclusive aquele xml padrao quando voce cria um projeto JFXML Commented 12/05/2018 às 23:34
  • Cara tenho um exemplo de um projeto meu se quiser dar uma olhada github.com/Phomint/Odonware, porque eu acho que é problema no Controller. Commented 12/05/2018 às 23:36
  • Vou ver sim! Muito obrigado por ajudar! Commented 12/05/2018 às 23:47

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .