edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
715 stars 107 forks source link

INFO: Execute command 'java -jar null/<MyApp>.jar' #121

Closed mertakozcan closed 6 years ago

mertakozcan commented 6 years ago

Hello,

I'm having a problem when launching the JAR.

Here is the full log message,

app git:(auto-update) ✗ java -jar fxlauncher.jar
logging to /var/folders/zx/nkwszczx5mx7nn68nsls4crr0000gn/T//fxlauncher.log
Jun 14, 2018 3:32:55 PM fxlauncher.AbstractLauncher syncFiles
INFO: Using cache dir .
Jun 14, 2018 3:32:55 PM fxlauncher.Launcher launchAppFromManifest
INFO: Show whats new dialog? false
Jun 14, 2018 3:32:55 PM fxlauncher.Launcher startApplication
INFO: Execute command 'java -jar null/MyApp-0.0.0.2.jar'

and here is my pom.xml,

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>MyApp</groupId>
    <artifactId>MyApp</artifactId>
    <version>0.0.0.2</version>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <!-- Installer Filename without suffix -->
        <app.filename>MyApp</app.filename>

        <!-- The JavaFX Application class name -->
        <app.mainClass>controller.MainApp</app.mainClass>

        <!-- The Application vendor used by javapackager -->
        <app.vendor>MyCompany</app.vendor>

        <!-- The Application version used by javapackager -->
        <app.version>0.0.0.2</app.version>

        <!-- Base URL where you will host the application artifacts -->
        <app.url>http://localhost:3000/</app.url>

        <!-- The app and launcher will be assembled in this folder -->
        <app.dir>${project.build.directory}/app</app.dir>

        <!-- Native installers will be built in this folder -->
        <app.installerdir>${project.build.directory}/installer</app.installerdir>

        <!-- Should the client downgrade if the server version is older than the local version? -->
        <app.acceptDowngrade>false</app.acceptDowngrade>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <!-- Compile project JAR to app.dir -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <outputDirectory>${app.dir}</outputDirectory>
                </configuration>
            </plugin>
            <!-- Copy dependencies to app.dir -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <excludeScope>provided</excludeScope>
                    <outputDirectory>${app.dir}</outputDirectory>
                    <stripVersion>true</stripVersion>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <!-- Generate app.xml manifest -->
                <executions>
                    <execution>
                        <id>create-manifest</id>
                        <phase>package</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>fxlauncher.CreateManifest</mainClass>
                            <arguments>
                                <argument>${app.url}</argument>
                                <argument>${app.mainClass}</argument>
                                <argument>${app.dir}</argument>
                                <argument>--accept-downgrade=${app.acceptDowngrade}</argument>
                                <argument>--include-extensions=jpg</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <!-- Embed app.xml inside fxlauncher.xml so we don't need to reference app.xml to start the app -->
                    <execution>
                        <id>embed-manifest-in-launcher</id>
                        <phase>package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>jar</executable>
                            <workingDirectory>${app.dir}</workingDirectory>
                            <arguments>
                                <argument>uf</argument>
                                <argument>fxlauncher.jar</argument>
                                <argument>app.xml</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>installer</id>
                        <phase>install</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>javapackager</executable>

                            <arguments>
                                <argument>-deploy</argument>
                                <argument>-native</argument>
                                <argument>-outdir</argument>
                                <argument>${app.installerdir}</argument>
                                <argument>-outfile</argument>
                                <argument>${app.filename}</argument>
                                <argument>-srcdir</argument>
                                <argument>${app.dir}</argument>
                                <argument>-srcfiles</argument>
                                <argument>fxlauncher.jar</argument>
                                <argument>-appclass</argument>
                                <argument>fxlauncher.Launcher</argument>
                                <argument>-name</argument>
                                <argument>${project.name}</argument>
                                <argument>-title</argument>
                                <argument>${project.name}</argument>
                                <argument>-vendor</argument>
                                <argument>${app.vendor}</argument>
                                <argument>-BappVersion=${app.version}</argument>
                                <argument>-Bidentifier=${project.groupId}.${project.artifactId}</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.11.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.4</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.2</version>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.197</version>
        </dependency>

        <dependency>
            <groupId>no.tornado</groupId>
            <artifactId>fxlauncher</artifactId>
            <version>1.0.19</version>
        </dependency>

        <dependency>
            <groupId>org.controlsfx</groupId>
            <artifactId>controlsfx</artifactId>
            <version>9.0.0</version>
        </dependency>
    </dependencies>

</project>

I'm not using scp but I have a webserver running in local (via localhost:3000) and I uploaded all the files that are created in target/app to my webserver.

When I run java -jar fxlauncher.jar, I saw loading progress indicator for a second, and then I got that log on console and application doesn't start.

Java version: 1.8.0_162 OS: MacOS Sierra

mertakozcan commented 6 years ago

I was trying with newer versions of plugins and FXLauncher dependencies. It worked when I used exact same versions in the example here.

Also, I added <app.cacheDir>USERLIB/FxlDemo</app.cacheDir> to properties.