Alex Rivera | Logout

Runtime error when deploying a JavaFX application

Asked 2012-09-14T13:43:32.490
9

I'm trying to deploy a JavaFX app. The app I've been working on is fairly complex and includes several libraries. When I create a jnlp and try to run it I always get a "Runtime error. Click for details" message. Someone suggested I try doing just a simple Hello World app to see if it's an issue with the included libraries. I tried that and I still get the "Runtime error."

Here's the build.xml I'm trying to use.

    <project name="App" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
        <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
             uri="javafx:com.sun.javafx.tools.ant"
             classpath="C:\Program Files\Java\jdk7\lib\ant-javafx.jar" />


        <target name="default">
        <fx:deploy width="600" height="400" outdir="${basedir}/dist" outfile="App">
            <fx:application name="App" mainClass="${javafx.main.class}"/>

            <fx:resources>
                <!-- include application jars -->
                <fx:fileset dir="${basedir}" includes="*.jar"/>
                <fx:fileset dir="${basedir}/lib" includes="*.jar"/> 
                <fx:fileset dir="${basedir}" includes="app.ini" />
                <fx:fileset dir="${basedir}/template" includes="*.template" />
            </fx:resources>

            <!-- request user level installation -->
            <fx:preferences install="false"/>
        </fx:deploy>
        </target>
    </project>

For the Hello World version I just removed the <fx:resources> section. I run both of them from inside eclipse as an ant task. They both created a dist folder in my project with a .jnlp and a .html file. I then click on the jnlp to run the app and see a small window that has the text, "Runtime error. Click for details.' I click it and get an error window that says, "The application failed to run. Th

Edit
Report

1 Answer

2

If you are using netbeans then Right Click on the Project and Go to Project Properties then to Libraries then click on Manage Platform then select the Default Javafx platform then go to JAVAFX tab and then change the JAVAFX SDK location to where your Java fx 2 sdk is and also similarly change the JAVAFX JRE. Hope this will solve your Problem.

answered 2013-02-15T18:28:20.143

Your Answer