JavaPackager | Maven plugin to package Java applications | DevOps library

 by   fvarrui Java Version: 1.7.5 License: GPL-3.0

kandi X-RAY | JavaPackager Summary

kandi X-RAY | JavaPackager Summary

JavaPackager is a Java library typically used in Devops, Gradle applications. JavaPackager has build file available, it has a Strong Copyleft License and it has low support. However JavaPackager has 8 bugs and it has 2 vulnerabilities. You can download it from GitHub, Maven.

JavaPackager is a hybrid plugin for Maven and Gradle which provides an easy way to package Java applications in native Windows, Mac OS X or GNU/Linux executables, and generate installers for them. SNAPSHOT version is not released to Maven Central, so you have to install it manually. :eyes: See JavaPackager changes and fixes.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              JavaPackager has a low active ecosystem.
              It has 765 star(s) with 103 fork(s). There are 17 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 26 open issues and 223 have been closed. On average issues are closed in 80 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of JavaPackager is 1.7.5

            kandi-Quality Quality

              OutlinedDot
              JavaPackager has 8 bugs (2 blocker, 0 critical, 3 major, 3 minor) and 150 code smells.

            kandi-Security Security

              JavaPackager has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              OutlinedDot
              JavaPackager code analysis shows 2 unresolved vulnerabilities (2 blocker, 0 critical, 0 major, 0 minor).
              There are 3 security hotspots that need review.

            kandi-License License

              JavaPackager is licensed under the GPL-3.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              JavaPackager releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              JavaPackager saves you 1888 person hours of effort in developing the same functionality from scratch.
              It has 4164 lines of code, 478 functions and 59 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed JavaPackager and discovered the below as its top functions. This is intended to give you an instant insight into JavaPackager implemented functionality, and help decide if they suit your requirements.
            • Apply the JRE to a package
            • Gets required modules
            • Convert additional module paths to parameters
            • Apply zip file to pack
            • Creates a tar file from the packager
            • Applies the manifest to the packager
            • Creates the assets
            • Performs the actual installation
            • Apply the dependencies to the packager
            • Generates the tar file
            • Creates a zip file
            • Apply mac
            • This method gets the application and generates AppImageTool
            • Generate the velocity file
            • Set a parameter with the given value
            • Creates the android app
            • Generate the MSPack file
            • Creates the app structure
            • Try to locate a license from a packager
            • Apply the velocity file to the assets folder
            • Creates a windows EXE file
            • Region CreateWindowsExe
            • Performs the actual install
            • Creates a native Java app bundle
            • Creates the actual manifest files
            • Performs the actual packager
            Get all kandi verified functions for this library.

            JavaPackager Key Features

            No Key Features are available at this moment for JavaPackager.

            JavaPackager Examples and Code Snippets

            No Code Snippets are available at this moment for JavaPackager.

            Community Discussions

            QUESTION

            How to use javapackager to create executable file for my code?
            Asked 2021-May-10 at 10:17

            I saw this stack overflow post to know how to create executable files from java source , where it says to use javapackager he also says that it is included with Java JDK but I dont have any clue of how to use it. I read this oracle documentation but still didn't get much how to create native type .exe file for my code like I tried it on cmd and it says javapackager is not a valid command , I found these ways old so How can I make a .exe file for my java code now .

            ...

            ANSWER

            Answered 2021-Apr-28 at 12:26

            javapackager was removed from the JDK. The recommended way is now (It is better,if you have a modular application) to use jlink and/or jpackage

            Source https://stackoverflow.com/questions/67299785

            QUESTION

            What does the * mean following a filename in Mac terminal
            Asked 2020-Sep-28 at 01:35

            Does anyone know what the * following a filename in macOS terminal means?

            All the file names in the folder:

            /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands

            have a * trailing them and I'm not sure why.

            For example:

            ...

            ANSWER

            Answered 2020-Sep-28 at 01:30

            As for the executable-looking emulator that you can't actually execute, this can happen when the dynamic loader requested by emulator doesn't exist. You can check what kind of file emulator is with the command file emulator, and check what dynamic loader and libraries it needs with ldd emulator (any line showing “not found” is something you need to install). Given the name of the directory and the size of the file, emulator is probably a Linux x86 binary. I suspect you have an amd64 system. If so, you need to install a runtime environment for 32-bit applications; on Ubuntu, you need the ia32-libs package (and perhaps also ia32-libs-gtk). You could also get this error message for a script whose interpreter as indicated in the #! line doesn't exist.

            https://superuser.com/questions/178786/what-does-the-asterisk-mean-after-a-filename-when-you-type-ls-l

            same question here.

            Source https://stackoverflow.com/questions/64094843

            QUESTION

            JavaFX packaging: NoClassDefFoundError
            Asked 2019-Oct-08 at 16:46

            I package a JavaFX application using maven and OpenJDK 1.8 The relevant part from my pom.xml:

            ...

            ANSWER

            Answered 2019-Oct-08 at 16:46

            Short answer

            I ran my jar with openJDK 11 which does not include JavaFX while building it with openJDK 8. Case closed.

            Findings, details and reasons

            Since my IDE was able to run my code without issues, I presumed the problem to be specific to my config/machine. As it turns out Canonical/Ubuntu decided

            [For] Bionic [...] move the default JRE/JDK in main to OpenJDK 11 in September/October 2018 as an SRU. AskUbuntu

            And, as pointed out on a different SO Thread:

            JavaFX 11 is not part of the JDK anymore StackOverflow

            (This also includes instructions how to fix this with JDK 11)

            And finally, as Murphy's law had it, I set up my packaging the project on October 4th, and decided to install eclipse via apt on October 8th which includes openjdk-11-jdk:amd64 (this is logged in the useful /var/log/apt/history.log).

            This also updated my /etc/alternatives/java to point to v11. Since I ran my jar without explicitly specifying the java binary, it broke.

            Running

            Source https://stackoverflow.com/questions/52761836

            QUESTION

            Add folder to bundle when build mac installer using javapackager
            Asked 2019-Aug-27 at 09:34

            I have JavaFx ShowTime.jar and config folder. To run the software, the config folder needs to be in a same directory as ShowTime.jar. In side the config folder, there are two folders : preferences and plugins.

            I can bundle the config folder with the jar using the following codes:

            ...

            ANSWER

            Answered 2019-Aug-27 at 09:34

            That's not how applications normally work. Modifiable configuration items are normally held in a separate user-specific folder. The name and location of this folder is in general different for each OS but a relatively common approach is to place an invisible folder inside the home directory of the user. Something like ".MyApplication" for example. This folder and its initial content has to be created by your software when the application is started for the first time. When a new version of the software is installed you may keep this folder because it is not overwritten by the installer.

            Source https://stackoverflow.com/questions/57667399

            QUESTION

            Java9 packager with jlink compress tags
            Asked 2019-Apr-17 at 01:42

            when we create jlink runtime images we can use tags such as '--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages' , creating a distribution folder around 45mb.

            If we want to use javapackager, for example to create an .DMG file, how can we do a similar compression? since these tags are not avaiable for javapackager. Without them the final bundle is around 100mb, losing a lot the java9 modularization advantages, so my question is if it is possible to use javapackager with JRE runtime images created by jlink.

            thanks

            ...

            ANSWER

            Answered 2017-Nov-15 at 16:07

            Answering my own question, we can just use the combination of two:

            For MacOSX example:

            1) generate a runtime dist with jlink, this will create a lib folder with around 50mb if you use compress tags.

            2) Generate MacOSX.app with javapackager, this .app will come with a runtime lib folder around 98mb.

            3) Simple replace them, right click MacOSX.app-> "show package contents", then go to Plugins/Java.runtime/Contents/Home/ and replace lib folder with the one generated by jLink.

            This way you have a self-contained Java app with around 50mb instead of 100mb, thanks to beautiful Java9 modules.

            Would be cool to do all of this just with javapackager, if it's possible I couldn't find how, I suggest to use something like gradle to execute all this process with 1 command.

            Source https://stackoverflow.com/questions/47287429

            QUESTION

            Is it possible to use javapackager on ZuluFX for Mac
            Asked 2019-Mar-17 at 01:34

            I was able to use ZuluFX 8 with javapackager on Windows. However, on a Mac I get this error:

            Bundler Mac Application Image skipped because of a configuration problem: Cannot determine which JRE/JDK exists in the specified runtime directory.
            Advice to fix: Point the runtime directory to one of the JDK/JRE root, the Contents/Home directory of that root, or the Contents/Home/jre directory of the JDK.

            It's pretty easy to just move the package into Contents/Home but I doubt that will work as it seems there is no JRE bundled with the Mac version of ZuluFX 8. Is this something that can be worked around?

            ...

            ANSWER

            Answered 2019-Mar-17 at 01:34

            It's pretty easy to just move the package into Contents/Home but I doubt that will work as it seems there is no JRE bundled with the Mac version of ZuluFX 8.

            From what I'm seeing, I'm not sure that's correct. The ZuluFx 8 archive for Mac contains a jre directory. I extracted the archive to ~/zuluFX and from there created the Contents/Home directory as required by MacOS and added a symbolic link to said jre directory there. I then set $JAVA_HOME accordingly:

            Source https://stackoverflow.com/questions/55142402

            QUESTION

            self-contained javafx application fail to run in ubuntu : issue with GLIBCXX_3.4.21
            Asked 2019-Feb-11 at 15:44
            • I built a small app using javafx ( very basic stuff )
            • compile using javac : OK ( oracle jdk 1.8.0_201-b09 )
            • crated the jar : OK : the jar works fine with java -jar
            • packaged the app using javapackager

              javapackager \ -deploy \ -daemon \ -srcfiles $JAR_FILE:./lib/$LIB_JAR.jar \ -outdir $DIST_FOLDER \ -outfile dist \ -native deb \ -appclass com.myapp.client.gui.Main \ -name "MyApp" \ -title "MyApp" \ -v

            • run the generated deb installer ( same machine )

            • go the the installed app under /opt/MyApp, and when I ran MyApp it just complains about GLIBCXX_3.4.21 not found

            I have tried all sort of apt fixes but nothing worked..

            it's worth mentioning that this is all done in a fresh ubuntu desktop version running from a virtual machine. ( ubuntu 14.04.1 amd64 )

            ...

            ANSWER

            Answered 2019-Feb-11 at 15:44

            Try with jdk8u181 or less. The provided launcher from the jdk (in lib/ant-javafx.jar -> ./com/oracle/tools/packager/linux/JavaAppLauncher ) doesn't have the same symbol tables. It looks like a bug in oracle's jdk compilation and distribution system.

            Source https://stackoverflow.com/questions/54564421

            QUESTION

            How to enforce packaged java app to run as admin
            Asked 2019-Feb-06 at 23:34

            I'm trying to package a java application using java packager tool ( I'm new to this tool ) the app itself has to make some calls internally ( using the java process api )

            This works fine if the java application is started with admin privileges. for example if I run my jar app as sudo java -jar application.jar from then all sub processes become admin as well.

            For distribution purpose , I do not have control over how the users will start the app. thus trying to use java packager tool- but I need to enforce that the app is ran with admin privileges. ( fine the app will stop if the user does not have sudo for example )

            The other workaround , which I strongly want to avoid is to ask the user to enter their admin/sudo password when I launch the internal processes..

            ---EDIT--- I think I needed to add more background after the comments and answer I got. as it looks to though the issue is about detecting admin or not.. this is not not what my issue is.

            ...

            ANSWER

            Answered 2019-Jan-30 at 06:42

            This is a sample implementation of Detect if Java application was run as a Windows admin with a little extra to indicate how I imagine it could work.

            MainClass

            This is the "launcher" if you will. It's ´main´ method checks for admin privileges. if they are present, the "Real" class is called with the arguments provided. The program will run in the exact jvm.

            If not, The user is prompted with a "this application needs admin privileges to run" message

            Source https://stackoverflow.com/questions/54383378

            QUESTION

            How to package app at Java 11 with non-modular dependencies
            Asked 2019-Jan-07 at 20:19

            I develop and distribute a Java Swing app that uses Apache Batik and JavaCV. I've updated it through java 1.6, 7 and 8. Installers for macOS, Windows and Linux are built with Javapackager. Java 8 is end of support in Jan '19 and I can't find a solution to package and distribute at Java 11, the new LTS version.

            Neither JavaCV or Batik produce modular jars but I have managed to repackage them to the point where I can compile and produce a runnable jar at Java 11, app works fine but I can't package it for distribution. I was planning dropping to Java 10 to use javapackager and bundle the 11 runtime from there but it uses jlink to produce a custom runtime, jlink fails because JavaCV and Batik aren't modular. jdeps won't produce a module-info.class to patch in and make them modular due to unsatisfied references in Batik and JavaCV, even though my app works fine without them.

            As a result I'm going to have to leave the code base at Java 8, and ship it even though no longer supported.

            I know there's a call to create a replacement for javapackager but that won't be there until way after Java 8 is deprecated. And I'd still need Batik and JavaCV projects to refactor and build modular jars to produce a custom runtime.

            Can anyone offer any other solution please? Have I missed something? Thanks.

            ...

            ANSWER

            Answered 2018-Dec-05 at 20:45

            So the only solution was to write a wrapper app that uses ProcessBuilder to launch the original apps jar.

            Advantage in this is that link can be used to produce the minimal required runtime. Place the jar in the bin directory, then use FPM (https://github.com/jordansissel/fpm) to create an installer.

            Sample code for the wrapper

            Source https://stackoverflow.com/questions/53548430

            QUESTION

            How to set DMG window and background size using javapackager ant task
            Asked 2018-Nov-12 at 23:20

            After long struggle I managed to generate (using Ant) on MacOSX (Yosemite) a DMG (of modular JavaFX application that deploys to *.app folder) even with custom icons of the app and DMG volume (both stored as *.icns files in build's package/macosx folder). Drag and drop works, it installs the app, the app launches so everything is fine. Well, almost.

            I was tempted to make also the custom background for DMG. It is placed together with the icons in package/macosx folder as App-background.png file (where App part is the name of my app, as it is with icons). And javapackager actually picks up the background, but unfortunately after opening DMG the background seems to be placed in windows' top-left corner, the window itself is like twice the size of the background, so 3/4 of the window's background is just white.

            I tried with different PNG sizes, but to no avail. DMG window is always way bigger than the image.

            Is there any way to make javapackager (aka fx:deploy which I actually use) to generate DMG with proper settings, that just make the DMG window fit background size?

            Edit: It seems like DMG window has actually the size of the PNG (the original background file), but for some reason the image, when displayed as background, is "slightly" scaled down.

            ...

            ANSWER

            Answered 2018-Nov-12 at 23:20

            After long investigation I found the (not so obvious and rather not direct) reason for this misbehavior. Fortunately I found also the solution.

            Apparently there's some problem with Finder handling PNG while displaying DMG file. It all comes down to chunk pHYs which contains 3 fields (4b, 4b and 1b long respectively). It is pixels per unit on x axis, pixels per unit on y axis and 0 or 1 for unit (0 no unit, 1 a meter unit). Playing with these values (via hex editor) did change somehow scaling behavior (and window size), but I wasn't able to figure out correct values. Eventually I get rid of this chunk completely (exporting from GIMP as PNG without saving resolution) and that solved the case.

            So for anyone struggling with this: just make sure, there is no pHYs chunk in PNG file.

            Edit: One can do that easily with ImageMagick:

            Source https://stackoverflow.com/questions/53242151

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install JavaPackager

            Useful to try SNAPSHOT versions.
            Download source code and change to the project directory:
            Compile, package and install the plugin in your local repository (ommit ./ on Windows):

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/fvarrui/JavaPackager.git

          • CLI

            gh repo clone fvarrui/JavaPackager

          • sshUrl

            git@github.com:fvarrui/JavaPackager.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular DevOps Libraries

            ansible

            by ansible

            devops-exercises

            by bregman-arie

            core

            by dotnet

            semantic-release

            by semantic-release

            Carthage

            by Carthage

            Try Top Libraries by fvarrui

            ReportSystemAPI

            by fvarruiJavaScript

            PowerPointToVideo

            by fvarruiJava

            Reviser

            by fvarruiJava

            HelloGDX

            by fvarruiJava

            HelloBot

            by fvarruiJava