0

This might be a duplicate, but even after searching I wasn't able to fix my problem, so that's why I am asking here for help.

I have created Java project in NetBeans 12.5, everything runs fine and compiles when I run it through IDE, the problem occurs when I try to create EXE file, by using Package As -> EXE installer option. Error is following:

C:\Users\Aldin\Documents\NetBeansProjects\Java_CarF_Manager\nbproject\build-native.xml:519: typedef class com.sun.javafx.tools.ant.FXJar cannot be found
 using the classloader AntClassLoader[]

When I click onto "C:\Users\Aldin\Documents\NetBeansProjects\Java_CarF_Manager\nbproject\build-native.xml:519:" it opens me build-native.xml file which I have no clue what is it used for and it selects following part of .XML code:

 <typedef name="fx_jar" classname="com.sun.javafx.tools.ant.FXJar" classpath="${javafx.ant.classpath}"/>

I've tried to google my problem and before asking question here I previously read that the reason why's this happening is because I am trying to compile a program without required dependencies, now if that's case here I'd like to request some in-depth guide how to setup these dependencies or someone to walk-me-through the process of adding them into my Project, because as I said I pretty much don't have clue about these files.

I am currently running Windows 10 OS.

helloworld
  • 166
  • 1
  • 2
  • 9
  • 2
    Try following this -> https://openjfx.io/openjfx-docs/. My understanding is that it is way more complicated to generate a EXE than just running a command in `Netbeans`. I could be wrong because I have not tried to create an EXE since Java 8. – SedJ601 Apr 19 '22 at 00:57
  • 1
    @Sedrick This makes sense and could potentially be solution. I will try this tomorrow and see how it goes (will keep you guys updated) as I am currently on my phone. Thanks for your comment I appreciate it. – helloworld Apr 19 '22 at 02:16
  • @Sedrick I've tried doing what you've suggested but unfortunately nothing. I still couldn't fix the error. – helloworld Apr 19 '22 at 08:28
  • 2
    There should not be any errors. What I suggested does not give you an option to create an EXE file. It will give you other means of running the Application, but you have to set up your project based on the scenario that is best for you. – SedJ601 Apr 19 '22 at 16:19
  • 1
    As a solution which might help others, what I did is deinstallation of Netbeans 12.5 and noticed new version (NetBeans 13) - upgraded to that + installed JDK + JavaFX again. Solved mentioned error that I get. Now I am stumbled upon another error which I've created new question for. Thanks on your idea and help @Sedrick. Again I highly appreciate it – helloworld Apr 19 '22 at 22:39
  • Related: [netbeans export to exe fails](https://stackoverflow.com/a/71932205/1155209). – jewelsea Apr 19 '22 at 23:18

0 Answers0