edvin / fxlauncher

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

Class fxlauncher/Launcher not found #174

Closed treloiii closed 5 years ago

treloiii commented 5 years ago

Hello, when I try to install program on another system , after installation it throws this error image How to fix that? 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">

4.0.0
<groupId>MyProject</groupId>
<artifactId>MyProject</artifactId>
<version>1.0</version>

<build>
    <plugins>
        <!-- Compile project jar to appdir -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.2</version>
            <configuration>
                <outputDirectory>${app.dir}</outputDirectory>
            </configuration>
        </plugin>
        <!-- Copy dependencies to appdir -->
        <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>&#45;&#45;cache-dir=${app.cacheDir}</argument>-->
                            <argument>--accept-downgrade=${app.acceptDowngrade}</argument>
                            <argument>--include-extensions=jpg</argument>
                            <!--<argument>${app.parameters}</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>
                <!-- Optional step to include custom UI, see https://github.com/edvin/fxlauncher-custom-ui -->
                <execution>
                    <id>embed-custom-ui-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>-C</argument>
                            <argument>C:/Users/Xiaomi/Desktop/fxlauncher-custom-ui-master/target/classes</argument>
                            <argument>.</argument>
                        </arguments>
                    </configuration>
                </execution>
                 <!--Create native installer. Feel free to add more arguments as needed.-->
                 <!--https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html-->

                <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>IzzyBot</argument>
                            <argument>-BappVersion=${app.version}</argument>
                            <argument>-Bidentifier=${project.groupId}.${project.artifactId}</argument>
                        </arguments>
                    </configuration>
                </execution>
                <!-- Copy application artifacts to remote site using scp (optional) -->
                <execution>
                    <id>deploy-app</id>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>scp</executable>
                        <arguments>
                            <argument>-r</argument>
                            <argument>target/app/.</argument>
                            <argument>${app.deploy.target}</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

    </plugins>
</build>

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

    <!-- The JavaFX Application class name -->
    <app.mainClass>controllers.Main</app.mainClass>

    <!-- Optional override to specify where the cached files are stored. Default is current working directory -->
    <!--<app.cacheDir>USERLIB/FxlDemo</app.cacheDir>-->

    <!-- Optional parameters to the application, will be embedded in the launcher and can be overriden on the command line -->
    <!--<app.parameters>&#45;&#45;myOption=myValue &#45;&#45;myOtherOption=myOtherValue</app.parameters>-->

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

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

    <!-- Base URL where you will host the application artifacts -->
    <app.url>http://lab4.std-763.ist.mospolytech.ru/getdown/</app.url>

    <!-- Optional scp target for application artifacts hosted at the above url -->
    <app.deploy.target>http://lab4.std-763.ist.mospolytech.ru/getdown/</app.deploy.target>

    <!-- 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>

<dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>4.0.0-alpha-1</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.5</version>
    </dependency>
    <dependency>
        <groupId>com.jfoenix</groupId>
        <artifactId>jfoenix</artifactId>
        <version>8.0.1</version>
    </dependency>
    <dependency>
        <groupId>org.jetbrains</groupId>
        <artifactId>annotations</artifactId>
        <version>RELEASE</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-htmlunit-driver</artifactId>
        <version>2.52.0</version>
    </dependency>

    <dependency>
        <groupId>no.tornado</groupId>
        <artifactId>fxlauncher</artifactId>
        <version>1.0.21</version>
    </dependency>
    <dependency>
        <groupId>org.controlsfx</groupId>
        <artifactId>controlsfx</artifactId>
        <version>8.40.11</version>
    </dependency>

</dependencies>

`

edvin commented 5 years ago

I was able to verify that from fxlauncher.jar and up, everything is in order. As you can see from the attached screenshot, your app ran perfectly and I got both the custom launcher ui and the login screen, no problem. Nice work!

I suspect there might be an issue with your executable. Can you perhaps post either the executable itself or the command and output used to build it?

image

treloiii commented 5 years ago

for build i use mvn install command , it builds me exe installer from javafxpackager there is my exe https://drive.google.com/open?id=1BeXaumhz_XSVBrN_5X48oKu1azGJlnfM

this output of install command [INFO] --- maven-install-plugin:2.4:install (default-install) @ IzzyBot --- [INFO] Installing C:\Users\Xiaomi\Downloads\SupremeDesignv2\target\app\IzzyBot-1.0.jar to C:\Users\Xiaomi\.m2\repository\IzzyBot\IzzyBot\1.0\IzzyBot-1.0.jar [INFO] Installing C:\Users\Xiaomi\Downloads\SupremeDesignv2\pom.xml to C:\Users\Xiaomi\.m2\repository\IzzyBot\IzzyBot\1.0\IzzyBot-1.0.pom [INFO] [INFO] --- exec-maven-plugin:1.6.0:exec (installer) @ IzzyBot --- No base JDK. Package will use system JRE. No base JDK. Package will use system JRE. Creating app bundle: IzzyBot in C:\Users\Xiaomi\Downloads\SupremeDesignv2\target\installer\bundles Result application bundle: C:\Users\Xiaomi\Downloads\SupremeDesignv2\target\installer\bundles Installer (.exe) saved to: C:\Users\Xiaomi\Downloads\SupremeDesignv2\target\installer\bundles Bundler MSI Installer skipped because of a configuration problem: Can not find WiX tools (light.exe, candle.exe). Advice to fix: Download WiX 3.0 or later from http://wix.sf.net and add it to the PATH. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:45 min [INFO] Finished at: 2019-08-19T16:49:32+03:00 [INFO] ------------------------------------------------------------------------ [INFO] --- maven-install-plugin:2.4:install (default-install) @ IzzyBot --- [INFO] Installing C:\Users\Xiaomi\Downloads\SupremeDesignv2\target\app\IzzyBot-1.0.jar to C:\Users\Xiaomi\.m2\repository\IzzyBot\IzzyBot\1.0\IzzyBot-1.0.jar [INFO] Installing C:\Users\Xiaomi\Downloads\SupremeDesignv2\pom.xml to C:\Users\Xiaomi\.m2\repository\IzzyBot\IzzyBot\1.0\IzzyBot-1.0.pom [INFO] [INFO] --- exec-maven-plugin:1.6.0:exec (installer) @ IzzyBot --- No base JDK. Package will use system JRE. No base JDK. Package will use system JRE. Creating app bundle: IzzyBot in C:\Users\Xiaomi\Downloads\SupremeDesignv2\target\installer\bundles Result application bundle: C:\Users\Xiaomi\Downloads\SupremeDesignv2\target\installer\bundles Installer (.exe) saved to: C:\Users\Xiaomi\Downloads\SupremeDesignv2\target\installer\bundles Bundler MSI Installer skipped because of a configuration problem: Can not find WiX tools (light.exe, candle.exe). Advice to fix: Download WiX 3.0 or later from http://wix.sf.net and add it to the PATH. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:45 min [INFO] Finished at: 2019-08-19T16:49:32+03:00 [INFO] ------------------------------------------------------------------------

edvin commented 5 years ago

Even the installer is working perfectly for me. Can you verify that C:\Users\Xiaomi\AppData\Local\IzzyBot\app contains all the app jars, including fxlauncher.jar, on the system where it fails? Replace Xiaomi with the current username on the relevant system of course :)

treloiii commented 5 years ago

Yes, I check that app folder contains fxlauncher.jar , also i find that this error throws on new windows user or on clean windows

edvin commented 5 years ago

I don't have any good ideas why this would fail though, everything seems to be in order. You could also try to run java -jar fxlauncher.jar from the app folder to verify that all files have been downloaded intact.

treloiii commented 5 years ago

I found solution, reason of this error was cyrillic symbols in installation path

edvin commented 5 years ago

Ah! Thanks for reporting back :)