2016-04-24 64 views
0

我已創建使用javafx8在Eclipse中的媒體播放器。該jar文件正確生成,但是當我運行可執行文件,下面的消息出現javafx8應用程序可執行

i get this when i run the app

這是我build.xml。我試圖做一些修改,但它不起作用。我使用jdk.1.8.0

<taskdef resource="com/sun/javafx/tools/ant/antlib.xml" 
     uri="javafx:com.sun.javafx.tools.ant" 
     classpathref="fxant"/> 
</target> 
<target name="setup-staging-area"> 
    <delete dir="externalLibs" /> 
    <delete dir="project" /> 
    <delete dir="projectRefs" /> 

    <mkdir dir="externalLibs" /> 

    <copy todir="externalLibs"> 
     <fileset dir="\Android programming\PiliPlayer"> 
      <filename name="images"/> 
     </fileset> 
    </copy> 

    <mkdir dir="project" /> 
    <copy todir="project"> 
     <fileset dir="D:\Android programming\PiliPlayer"> 
      <include name="src/**" /> 
     </fileset> 
    </copy> 

    <mkdir dir="projectRefs" /> 
</target> 
<target name='do-compile'> 
    <delete dir="build" /> 
    <mkdir dir="build/src" /> 
    <mkdir dir="build/libs" /> 
    <mkdir dir="build/classes" /> 

    <!-- Copy project-libs references --> 
    <copy todir="build/libs"> 
     <fileset dir="externalLibs"> 
      <include name="images"/> 
     </fileset> 
    </copy> 

    <!-- Copy project references --> 

    <!-- Copy project sources itself --> 
    <copy todir="build/src"> 
     <fileset dir="project/src"> 
      <include name="**/*"/> 
     </fileset> 
    </copy> 

    <javac includeantruntime="false" source="1.8" target="1.8" srcdir="build/src" destdir="build/classes" encoding="Cp1252"> 
     <classpath> 
      <fileset dir="build/libs"> 
       <include name="*"/> 
      </fileset> 
     </classpath> 
    </javac> 

    <!-- Copy over none Java-Files --> 
    <copy todir="build/classes"> 
    <fileset dir="project/src"> 
     <exclude name="**/*.java"/> 
    </fileset> 
    </copy> 


</target> 
<target name="do-deploy" depends="setup-staging-area, do-compile, init-fx-tasks"> 
    <delete file="dist"/> 
    <delete file="deploy" /> 

    <mkdir dir="dist" /> 
    <mkdir dir="dist/libs" /> 

    <copy todir="dist/libs"> 
     <fileset dir="externalLibs"> 
      <include name="*" /> 
     </fileset> 
    </copy> 


    <fx:resources id="appRes"> 
     <fx:fileset dir="dist" includes="PiliPlayer.jar"/> 
     <fx:fileset dir="dist" includes="libs/*"/> 
    </fx:resources> 

    <fx:application id="fxApplication" 
     name="PILI PLAYER" 
     mainClass="application.VedaPlayer" 
    /> 

    <mkdir dir="build/classes/META-INF" /> 



    <fx:jar destfile="dist/PiliPlayer.jar"> 
     <fx:application refid="fxApplication"/> 
     <fileset dir="build/classes"> 
     </fileset> 
     <fx:resources refid="appRes"/> 

     <manifest> 
      <attribute name="Implementation-Vendor" value="PlLI AND VEDA"/> 
      <attribute name="Implementation-Title" value="PILI PLAYER"/> 
      <attribute name="Implementation-Version" value="1.0"/> 
      <attribute name="JavaFX-Feature-Proxy" value="None"/> 
     </manifest> 
    </fx:jar> 


    <mkdir dir="deploy" /> 
    <!-- Need to use ${basedir} because somehow the ant task is calculating the directory differently --> 
    <fx:deploy 
     embedJNLP="false" 
     extension="false" 
     includeDT="false" 
     offlineAllowed="true" 
     outdir="${basedir}/deploy" 
     outfile="Pili Player" nativeBundles="msi" 
     updatemode="background" > 

     <fx:platform basedir="${java.home}"/> 
     <fx:info title="Pili Player" vendor="PlLI AND VEDA"/> 

     <fx:application refId="fxApplication"/> 
     <fx:resources refid="appRes"/> 
    </fx:deploy> 


</target> 

請幫助我。

回答

0

太少信息給一個確切的答案,但你可以嘗試實施記錄在你的主類,所以你可以在你的日誌文件看,什麼樣的異常被拋出,以及爲什麼。

相關問題