Code Monkey home page Code Monkey logo

Comments (30)

aabhaanjan avatar aabhaanjan commented on September 28, 2024 2

yes.. thanks :)

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

Did you run mvn package when you got this error or did you run the embed-manifest-in-launcher step manually? If you ran it manually you must call mvn package first. If this doesn't help, can you post your complete pom.xml?

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

I run mvn package first but when renamed as per jar

uf
fxlauncher-1.0.13.jar
app.xml

than its showing sucessfully added but in app.xml my application is not embedded not even myproject.jar is three.. its not working :(

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

I solved the above using maven-jar-plugin which copied myproject.jar into app folder and its working fine with the executable jar. Now I am trying to create native window build and it is showing following error:
Bundler Windows Application Image skipped because of a configuration problem: Main application jar is missing.
Advice to fix: Make sure to use fx:jar task to create main application jar.
Bundler EXE Installer skipped because of a configuration problem: Main application jar is missing.
Advice to fix: Make sure to use fx:jar task to create main application jar.
Bundler MSI Installer skipped because of a configuration problem: Main application jar is missing.
Advice to fix: Make sure to use fx:jar task to create main application jar.

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

Is your project public or can you post at least the pom.xml file?

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

Hi below is my pom.xml now everything works fine just getting error of missing icon in iss file when trying to create window installer. How I can add lisence and icon files:
ERROR is
java.io.IOException: Exec failed with code 2 command [[C:\Program Files (x86)\Inno Setup 5\iscc.exe, /oC:\Users\Aava\Desktop\Dad\BurnAndTurn\target\installer\bundles, C:\Users\Aava\AppData\Local\Temp\fxbundler8483742052977282676\images\win-exe.image\BurnAndTurn.iss] in C:\Users\Aava\AppData\Local\Temp\fxbundler8483742052977282676\images\win-exe.image
at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:165)
at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:138)
at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:132)
at com.oracle.tools.packager.windows.WinExeBundler.buildEXE(WinExeBundler.java:697)
at com.oracle.tools.packager.windows.WinExeBundler.bundle(WinExeBundler.java:366)
at com.oracle.tools.packager.windows.WinExeBundler.execute(WinExeBundler.java:173)
at com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:352)
at com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:319)
at com.sun.javafx.tools.packager.Main.main(Main.java:476)
Error: Bundler "EXE Installer" (exe) failed to produce a bundle.
Pom.xml
4.0.0
MyApp
MyApp
0.0.1

     <!-- Installer Filename without suffix -->
<!-- Application Name -->
<app.filename>${project.name}</app.filename>

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

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

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

<!-- Base URL where you will host the application artifacts -->
<app.url>http://www.culpzlab.com/game/</app.url>
 <app.acceptDowngrade>false</app.acceptDowngrade>

<!-- Optional scp target for application artifacts hosted at the above url
<app.deploy.target>[email protected]:fxldemo</app.deploy.target>-->


</properties>


<build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
     <!-- Compile project jar to appdir -->
                   <plugin>
                       <groupId>org.apache.maven.plugins</groupId>
                       <artifactId>maven-jar-plugin</artifactId>
                       <version>2.6</version>
                       <configuration>
                           <outputDirectory>${app.dir}</outputDirectory>
                      </configuration>
                   </plugin>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>
    <configuration>
    <compilerArguments>
        <endorseddirs>${basedir}/src/main/resources/sfs</endorseddirs>
      </compilerArguments>
              <source>1.8</source>
              <target>1.8</target>
              <mainClass>com.culpzlab.Main</mainClass>
            </configuration>
  </plugin>

     <plugin>
      <groupId>com.zenjava</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>8.1.2</version>
            <configuration>
            <appName>MyApp</appName>
            <title>MyApp</title>
            <description>MyApp-sample</description>
            <vendor>example</vendor>
                <mainClass>com.culpzlab.Main</mainClass>
                <verbose>true</verbose>
                 <bundler>EXE</bundler>
                <bundleArguments>
                        <icon.ico>src/main/deploy/package/windows/MyApp.ico</icon.ico>
                        <icon.png>src/main/deploy/package/windows/MyApp.png</icon.png>
                </bundleArguments>
                <needShortcut>true</needShortcut>
                 <additionalAppResources>src/main/deploy/package/windows</additionalAppResources><!-- name does not matter, it's just some folder :D -->

            </configuration>

        </plugin>
        <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.10</version>
    <executions>
      <execution>
        <id>copy-dependencies</id>
        <phase>package</phase>
        <goals>
          <goal>copy-dependencies</goal>
        </goals>
        <configuration>
                <outputDirectory>${app.dir}</outputDirectory>
          <overWriteReleases>false</overWriteReleases>
          <overWriteSnapshots>false</overWriteSnapshots>
          <overWriteIfNewer>true</overWriteIfNewer>
        </configuration>
      </execution>
    </executions>
  </plugin>


        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.4.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>--cache-dir=${app.cacheDir}</argument>
                            <argument>--accept-downgrade=${app.acceptDowngrade}</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-1.0.13.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>${project.basedir}/../fxlauncher-custom-ui/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-1.0.13.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>${app.version}</argument>
                            <argument>${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>${app.dir}/.</argument>
                            <argument>${app.deploy.target}</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
        </plugin>
</plugins>
smartfox sfs2x-api 1.0.1 compile
    <dependency>
        <groupId>smartfox</groupId>
        <artifactId>sfs2x-client-core</artifactId>
        <version>1.0.1</version>
         <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>smartfox</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.0.1</version>
    </dependency>

    <dependency>
        <groupId>smartfox</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.0.1</version>
    </dependency>
    <!-- add slf4j interfaces to classpath -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.6.4</version>
        <scope>compile</scope>
    </dependency>

    <!-- add commons logging to slf4j bridge to classpath -->
    <!-- acts as jcl but routes commons-logging calls to slf4j -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.6.4</version>
        <scope>runtime</scope>
    </dependency>

    <!-- add log4j binding to classpath -->
    <!-- routes slf4j calls to log4j -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.4</version>
        <scope>runtime</scope>
    </dependency>

    <!-- add log4j to classpath -->
    <!-- does the logging -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
    </dependency>
    <dependency>
        <groupId>smartfox</groupId>
        <artifactId>netty</artifactId>
        <version>1.0.1</version>
    </dependency>
    <dependency>
          <groupId>javafx</groupId>
          <artifactId>jfxrt</artifactId>
          <version>${java.version}</version>
          <scope>system</scope>
          <systemPath>${java.home}/lib/ext/jfxrt.jar</systemPath>
    </dependency>

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

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

You don't need the javafx-maven-plugin at all, so you can remove that. To make javapackager include a custom icon, have a look at the documentation here:

https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html

It states that you should add icon parameter to the bundler arguments, so add this line at the bottom of the arguments section:

<argument>-Dicon=path/to/icon</argument>

Make sure that the icon is .ico for Windows builds. You can have different options based on platform using profiles if you need to :)

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

Hi edvin
Thanks for your quick response. one more help please( I know this is not relevant to your plugin)

  1. when I am trying to add lisence file using following code:
    -BlicenseFile=src/main/resources/lisence.rtf

Advice to fix: Make sure that "src/main/resources/lisence.rtf" references a file in the app resources, and that it is relative file reference.
I know there is problem with path I am new in java not able to solve it. It would be great help if you can give me an example.

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

Hi!

The -BlicenseFile= must be relative to the app dir where the app is assembled, so probable you need to add ../../ to that path.

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

I saw this message, but then it dissappeared:

"When i am trying to make a mac native installer I am getting following error(when I am using jfx:native it creates the dmg sucessfully but when I am running exec:exec@installer mentioned error is thrown)
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (installer) on project myApp: Command execution failed. Cannot run program "javapackager" (in directory "/Users/abc/Desktop/myApp"): error=2, No such file or directory -> [Help 1]"

I guess you figured out that you need to have javapackager in your path :) Basically, put the bin directory of your Java installation on the path and rerun. Verify that you can successfully run javapackager from the command line before attempting the exec:exec@installer goal.

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

One more(I hope last one): jar is working fine but when i am trying run application using dmg:
java.lang.RuntimeException: java.nio.file.FileSystemException: /Volumes/ABC/ABC.app/Contents/Java/${app.cacheDir}: Read-only file system
at fxlauncher.FXManifest.resolveCacheDir(FXManifest.java:97)
at fxlauncher.Launcher.createApplication(Launcher.java:173)
at fxlauncher.Launcher.lambda$start$0(Launcher.java:85)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.file.FileSystemException: /Volumes/ABC/ABC.app/Contents/Java/${app.cacheDir}: Read-only file system
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
at java.nio.file.Files.createDirectory(Files.java:674)
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
at java.nio.file.Files.createDirectories(Files.java:767)
at fxlauncher.FXManifest.resolveCacheDir(FXManifest.java:95)
... 3 more

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

You have not defined a property called app.cacheDir but you have included this line in the CreateManifest step:

<argument>--cache-dir=${app.cacheDir}</argument>

Either remove that argument, or define the property. I suggest you just remove it if you don't need to place the cache in a particular folder.

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

Jar is working perfectly but when trying to run via installer getting :(
java.lang.ClassNotFoundException: com.lab.Main
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at fxlauncher.Launcher.createApplication(Launcher.java:179)
at fxlauncher.Launcher.lambda$start$0(Launcher.java:85)
at java.lang.Thread.run(Thread.java:745)

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

Have you deployed the app so I can test it?

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

Seems I missed something a fresh upload is working fine..at my system. One issue I am facing in others macbook where launcher get stuck into 75%.. also I found that one those system latest java is not installed.. is it the reason? how I can embed java with the application?

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

Yeah, without control of the Java installation on the client you'll face many "interesting" issues. You should run the installer step described in the pom (mvn exec:exec@installer) to create an executable binary that includes the JRE. This must be done only once per platform you want to support (Windows, Mac, Linux) and then you just need to deploy the app resources going forward.

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

Does it mean.. First I should run exec:@exec@installer and then upload resources of app folder?

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

It doesn't matter what order you do it in, just do mvn package && mvn exec:exec@installer and you should get an executable installer with your JRE. Do start the app after it is installed, you just need to have run deploy a single time so that the app resources are in the remote location.

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

I have run command clean package and deployed the resources then run exec@installer and used built dmg.. Am I on right direction?

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

Running command mvn exec:exec@installer is throwing error while exec:exec@installer not..

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

What's the error?

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

Unknown lifecycle phase "mvn"

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

Seems like you're running mvn mvn exec:exec@installer instead of mvn exec:exec@installer.

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

I followed the Same way but still my dmg is not loading jar files

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

What does that mean? I need the concrete error message you're receiving. Do you get a DMG and you can install it fine, but when you run the application you get an error message?

from fxlauncher.

aabhaanjan avatar aabhaanjan commented on September 28, 2024

I am able to create DMG when I run it in other system it installed the app but when I click on app it get stucked in loading bar at 100% not launching the application jar file.. it is not throwing any error.. just not launching the application after completing 100% in bar

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

At first thought I would think something goes wrong once the app starts. To check this, run the application from the command line. I don't have a Mac here right now, but basically you would open a terminal cd into the app folder, then into MacOS/Contents or something like that and run the app from there. When the app fails you should see a stack trace on your console which would hint to what's going wrong. If you can post the stack trace here we'll see if we can figure it out :)

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

Closing due to inactivity.

from fxlauncher.

mkotsovoulou avatar mkotsovoulou commented on September 28, 2024

mvn package
gives java.io.FileNotFoundException: fxlauncher.jar (No such file or directory)
while a few steps above it successfully creates the dependencies:

[INFO] Copying fxlauncher-1.0.16.jar to /Volumes/Data/IdeaProjects/myMavenApp/target/dependency/fxlauncher.jar

If I manually copy fxlauncher.jar to: target/app/ then packaging works well.
My app is a just a test for fxlauncher and I have just managed to deploy to my web server as well...
Any ideas why packaging fails?

Best,
Mairako

from fxlauncher.

edvin avatar edvin commented on September 28, 2024

Please open a new issue and post your complete pom.xml :)

from fxlauncher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.