samedi 25 juin 2016

Error invoking method. and Failed to launch JVM - Native Package will build but not launch

Can anyone shed any light more specifically on where my problem resides, and how to fix it? I'm running: Windows 7 Eclipse Mars.2 Release (4.5.2) I've followed the instructions closely and repeatedly for Marco's Tutorial on code.makery.ch (code.makery.ch/library/javafx-8-tutorial/part7/) I've deployed an earlier native package of this program before, with some trouble, but eventually successfully after adding -vm C:Program FilesJavajdk1.8.0_91binjavaw.exe to eclipse.ini After finally getting the ant build to run successfully, do-deploy: [copy] Copying 2 files to C:Usersadministrator.SUNDANCEIdeaProjectsPOA 1.1 Build MasterPOA 1.1 - Try 1builddistlibs [mkdir] Created dir: C:Usersadministrator.SUNDANCEIdeaProjectsPOA 1.1 Build MasterPOA 1.1 - Try 1buildbuildclassesMETA-INF Using base JDK at: C:Program FilesJavajdk1.8.0_91jre Using base JDK at: C:Program FilesJavajdk1.8.0_91jre Installer (.exe) saved to: C:Usersadministrator.SUNDANCEIdeaProjectsPOA 1.1 Build MasterPOA 1.1 - Try 1builddeploybundles BUILD SUCCESSFUL Total time: 56 seconds My main file looks like this: import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.image.Image; import javafx.stage.Stage; /** * Created by Brad on 5/20/2016. * Solely used to load the FXML and set the icons. Everything else is done in Controller.java */ public class Main extends Application { public static FXMLLoader loader; //Icon from https://icons8.com @Override public void start(Stage primaryStage) throws Exception{ loader = new FXMLLoader(); loader.setLocation(Main.class.getResource("view/Arrivals_Layout1.fxml")); Parent root = loader.load(); primaryStage.getIcons().add(new Image(ClassLoader.getSystemResourceAsStream("resources/images/Pallet-96.png"))); primaryStage.getIcons().add(new Image(ClassLoader.getSystemResourceAsStream("resources/images/pallet_96_allsizes.ico"))); primaryStage.setTitle("Purchase Order Arrivals"); primaryStage.setScene(new Scene(root)); primaryStage.setMinWidth(820); primaryStage.setMinHeight(375); primaryStage.show(); } public static void main(String[] args) { launch(args); } } My Package Explorer looks something like this, if it helps My PATH: C:ProgramDataOracleJavajavapath;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:Program Files (x86)IBMClient AccessEmulator;C:Program Files (x86)IBMClient AccessShared;C:Program Files (x86)IBMClient Access;C:Program FilesMicrosoft SQL Server110DTSBinn;C:Program Files (x86)Microsoft SQL Server110ToolsBinnManagementStudio;C:Program Files (x86)Microsoft SQL Server110ToolsBinn;C:Program FilesMicrosoft SQL Server110ToolsBinn;C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEPrivateAssemblies;C:Program Files (x86)Microsoft SQL Server110DTSBinn;C:Program FilesTortoiseHg;C:Program Files (x86)Inno Setup 5 The build.xml: <?xml version="1.0" encoding="UTF-8"?> <project name="POA 1.1 - Try 1" default="do-deploy" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"> <target name="init-fx-tasks"> <path id="fxant"> <filelist> <file name="${java.home}..libant-javafx.jar"/> <file name="${java.home}libjfxrt.jar"/> <file name="${basedir}"/> </filelist> </path> <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="C:Program FilesJavasqljdbc_4.2enu"> <filename name="sqljdbc42.jar"/> </fileset> </copy> <copy todir="externalLibs"> <fileset dir="C:Usersadministrator.SUNDANCEIdeaProjectsPOA 1.1 Build MasterPOA 1.1 - Try 1builddist"> <filename name="POA 1.1 - Try 1.jar"/> </fileset> </copy> <mkdir dir="project" /> <copy todir="project"> <fileset dir="C:Usersadministrator.SUNDANCEIdeaProjectsPOA 1.1 Build MasterPOA 1.1 - Try 1"> <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="sqljdbc42.jar"/> <include name="POA 1.1 - Try 1.jar"/> </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="POA 1.1 - Try 1.jar"/> <fx:fileset dir="dist" includes="libs/*"/> <fx:fileset dir="dist" includes="resources/**"/> </fx:resources> <fx:application id="fxApplication" name="Purchase Order Arrivals" mainClass="Main" version="1.1" /> <mkdir dir="build/classes/META-INF" /> <fx:jar destfile="dist/POA 1.1 - Try 1.jar"> <fx:application refid="fxApplication"/> <fileset dir="build/classes"> </fileset> <fx:resources refid="appRes"/> <manifest> <attribute name="Implementation-Vendor" value="Ugma Development"/> <attribute name="Implementation-Title" value="Purchase Order Arrivals"/> <attribute name="Implementation-Version" value="1.1"/> <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="POA 1.1 - Try 1" nativeBundles="exe" updatemode="background" > <fx:platform basedir="${java.home}"/> <fx:info title="POA 1.1 - Try 1" vendor="Ugma Development"/> <fx:application refId="fxApplication"/> <fx:resources refid="appRes"/> </fx:deploy> </target> </project> The .exe is generated and installs the program in /AppData. The program will compile and run fine in Eclipse, but when I run the installed version, I get: Error invoking method. first and then after clicking OK Failed to launch JVM I've tried seemingly everything: I've read multiple similar questions, and have scoured the internet, but have yet to vault this problem. Examples of the many I've read with vague or no answers: Error invoking method, failed to launch jvm javafx native pakage error invoking method Because he is less masterful in deployment, Marco himself said to come ask the mighty world of Stack Exchange: http://code.makery.ch/library/javafx-8-tutorial/part7/#comment-2233862311 Again, any specific light on where my problem resides, and how to fix it?

Aucun commentaire:

Enregistrer un commentaire