0

I am currently building a JavaFX application using IntelliJ IDE(INTELIJ IDEA 2017.1.6 version precisely). Running the application has been fine and great until I wanted to build the artifacts or bundle the application but unfortunately, It has refused to build or rebuild the project. I have tried

File > Invalidate Caches / Restart...
and also tried:
sudo git clean -dfx
(but it removed the .idea, build and lib folder that contains the libraries needed to the application to run - thank God I already had the backup of the folder so I was able to replace it as it couldn't run also)
as described here java.lang.NoClassDefFoundError: org/apache/tools/ant/util/ReaderInputStream vaadin+gradle+intelliJ

I also tried (NoClassDefFound: org/apache/tools/ant/util/ReaderInputStream) out. But this project is using Intelij default JavaFX build without gradle.

project.iml file contents:

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="hibernate" name="Hibernate">
      <configuration>
        <datasource-map>
          <unit-entry name="major:hibernate.cfg.xml" />
        </datasource-map>
        <naming-strategy-map />
        <deploymentDescriptor name="hibernate.cfg.xml" url="file://$MODULE_DIR$/src/major/MembershipAccount.hbm.xml" />
        <deploymentDescriptor name="hibernate.cfg.xml" url="file://$MODULE_DIR$/src/major/hibernate.cfg.xml" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" name="Hibernate 5.2.16-5.2.16" level="project" />
    <orderEntry type="library" name="mysql:mysql-connector-java:5.1.46" level="project" />
    <orderEntry type="library" name="mysql:mysql-connector-java:5.1.40" level="project" />
    <orderEntry type="library" name="de.jensd:fontawesomefx-commons:9.1.2" level="application" />
    <orderEntry type="library" name="de.jensd:fontawesomefx-fontawesome:4.7.0-9.1.2" level="application" />
    <orderEntry type="library" name="de.jensd:fontawesomefx-emojione:3.1.1-9.1.2" level="application" />
    <orderEntry type="library" name="de.jensd:fontawesomefx-icons525:4.2.0-9.1.2" level="application" />
    <orderEntry type="library" name="de.jensd:fontawesomefx-weathericons:2.0.10-9.1.2" level="application" />
    <orderEntry type="library" name="org.controlsfx:controlsfx:8.40.12" level="project" />
  </component>
</module>

EDIT:IT IS USING IT'S DEFAULT BUILD TOOL SEE ATTACHED IMAGE enter image description here

Please, I really need to deploy this. any help or suggestion is highly appreciated.

ARTIFACT SETTINGS SCREENSHOTS enter image description here

lightup
  • 634
  • 8
  • 18
  • At what point do you get this error? Are you using Ant, Ivy, Maven or any other build tool? – Itai Jul 09 '18 at 07:15
  • @Itai it is using it's default IDE build system without any external build tool. See the Edit. – lightup Jul 09 '18 at 07:33
  • Do you face the same problem with new simple JavaFX project? Could you please share screenshots with your artifact settings? – y.bedrov Jul 09 '18 at 11:05
  • @y.bedrov I tried that out and it worked well. Just that it only built jar file without including the deb and windows executable code. but this one seems not to work after Rebuilding it. Still trying to figure out why. What's baffling is that it is running on the IDE when I click run but rebuilding still gives same error as above. – lightup Jul 09 '18 at 18:23

1 Answers1

0

Fortunately, I got it working after @y.bedrov suggested I try a new build which is a definite way of finding out what is wrong with the build. I created a new JAVAFX Project, then build, rebuild and also build artifact and they both worked. but fortunately, build artifact wasn't using the direct build process like the build and rebuild so that was what stopped the project I was building from working after deployment.
See screenshot for a better understanding of what I found out.
NORMAL BUILD (didn't suffice)
Using Build Artifact: enter image description here I Had to Resort To Clean, Building and Rebuilding Only Using Build Artifacts command which pops up a menu as shown below.

enter image description here This is where I must build or rebuild or clean for it to work.

enter image description here

Build was successful as you can see. it also ran well enter image description here Building again using the Previous build project didn't still work and as shown above. Well, I am happy that it finally works. This solves my problem. hope it helps someone else. Thanks for your help @Itai and @y.bedrov

lightup
  • 634
  • 8
  • 18