Closed ghost closed 3 years ago
On Linux, such errors are common when your linux-destro does not support rpm type of packaging.
You can easily resolve this issue by installing alien.
Just open a shell (Terminal) and run this command:
sudo apt install alien
After this once again run jpackage in your Intellij IDEA.
Launch the application from the terminal by the command:
/opt/hellofx/bin/hellofx
And see if any error comes.
Then the following issues may be responsible:
.desktop
) is missing which is the desktop configuring file used to launch an application..desktop
file is not correctly configuredIt would be better if you would provide the build.gradle
file.
I can give you the tutorial easily but luckily jpackage provides a desktop configuration file by default. You just have to mention this in your code : --linux-shortcut
runtime{ .. jpackage{ .. if(curentOs.linux){ installerOptions += ['--linux-shortcut'] } .. } .. }
But still if you want to configure yourself for more perfection, you may contact me and I will help you out.
Please see this
Though it is some times not recommended, but I have found this very effective. In your build.gradle,
set --resource-dir
to $project.root/src/main/resources
Please place the $project.root/src/main/resources
in double quotation("
)
Replace "$project.root/src/main/resources"
with "--resource-dir"
and "build/jpackage/hellofx/lib"
with "$project.root/src/main/resources"
Replace "$project.rootDir/src/main/resources" with "--resource-dir"
first one only
Use this:
plugins { id 'application' id 'org.openjfx.javafxplugin' version '0.0.9' id 'org.beryx.runtime' version '1.11.3' }
repositories { mavenCentral() flatDir { dirs 'libs' } }
dependencies { implementation name: 'bridj-0.6.3-20130316.190111-13' implementation name: 'slf4j-api-1.7.2' implementation name: 'ps' }
javafx { modules = [ 'javafx.base', 'javafx.graphics', 'javafx.controls', 'javafx.fxml', 'javafx.media', 'javafx.web'] }
application { mainClassName = "a.Launcher" applicationName = 'hellofx' }
runtime { options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] launcher { noConsole = true } jpackage { def currentOs = org.gradle.internal.os.OperatingSystem.current() def imgType = currentOs.windows ? 'ico' : currentOs.macOsX ? 'icns' : 'png' imageOptions += ['--icon', "src/main/resources/hellofx.$imgType"] installerOptions += ["--resource-dir", "$project.rootDir/src/main/resources"] installerOptions += ['--vendor', 'parasuraam'] if(currentOs.windows) { installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut'] } } }
What is the name of your project and the package?
And what is the application name?
On Tue, Sep 22, 2020, 1:10 PM parasuraam notifications@github.com wrote:
Project name : hellofx
Package : a
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/beryx-gist/badass-runtime-example-javafx/issues/17#issuecomment-696560355, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM7LWIPEIRLR7WBUBANA4HTSHBIGNANCNFSM4RRNOH7Q .
Try this method:
Use this build.gradle:
plugins { id 'application' id 'org.openjfx.javafxplugin' version '0.0.9' id 'org.beryx.runtime' version '1.11.3' }
repositories { mavenCentral() flatDir { dirs 'libs' } }
dependencies { implementation name: 'bridj-0.6.3-20130316.190111-13' implementation name: 'slf4j-api-1.7.2' implementation name: 'ps' }
javafx { modules = [ 'javafx.base', 'javafx.graphics', 'javafx.controls', 'javafx.fxml', 'javafx.media', 'javafx.web'] }
application { mainClassName = "a.Launcher" applicationName = 'hellofx' }
runtime { options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] launcher { noConsole = true } jpackage { def currentOs = org.gradle.internal.os.OperatingSystem.current() def imgType = currentOs.windows ? 'ico' : currentOs.macOsX ? 'icns' : 'png' imageOptions += ['--icon', "src/main/resources/hellofx.$imgType"] installerOptions += ["--resource-dir", "$project.rootDir/src/main/resources"] installerOptions += ['--vendor', 'parasuraam'] if(currentOs.windows) { installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut'] } if(curentOs.linux){ installerOptions += ['--linux-shortcut', '--verbose'] } } }
2.sync it in your IDE.
./gradlew -i clean jpackage
Yes @parasuraam , it will work for any linux os of the architecture, amd64.
when I execute this
./gradlew -i clean jpackage
command . it comes like this
For this problem, you will have to run chmod +x gradlew
in that directory and hit enter and run the command again.
I want to create a jpackage for all linux os and all architectures.
how can I do this ?
Creating one platform dependent package for all the architecture is not possible. You need different packages for different architectures.
have you installed Java (JDK)? if not then install from here https://www.azul.com/downloads/zulu-community/?os=debian&architecture=x86-64-bit&package=jdk
Please download the .deb file
Please place another copy of the icon in the src/main/resources directory with the name, PCOID. png and PLEASE use this build.gradle :
plugins { id 'application' id 'org.openjfx.javafxplugin' version '0.0.9' id 'org.beryx.runtime' version '1.11.3' }
repositories { mavenCentral() flatDir { dirs 'libs' } }
dependencies { implementation name: 'bridj-0.6.3-20130316.190111-13' implementation name: 'slf4j-api-1.7.2' implementation name: 'ps' }
javafx { modules = ['javafx.controls', 'javafx.fxml'] }
application { mainClassName = "org.example.hellofx.Launcher" applicationName = 'PCOID' }
runtime { options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] launcher { noConsole = true } jpackage { def currentOs = org.gradle.internal.os.OperatingSystem.current() def imgType = currentOs.windows ? 'ico' : currentOs.macOsX ? 'icns' : 'png' imageOptions += ['--icon', "src/main/resources/PCOID.$imgType"] installerOptions += ['--resource-dir', "$project.rootDir/src/main/resources"] installerOptions += ['--vendor', 'PRADEEP'] if(currentOs.windows) { installerOptions += ['--win-per-user-install', '--win-dir-chooser', '--win-menu', '--win-shortcut'] } if(currentOs.linux){ installerOptions += ['--linux-shortcut', '--verbose'] } } }
Then sync in the Intellij IDE and in Terminal do the same.
According to this line:
Using custom package resource [menu icon] (loaded from PCOID.png).
From your verbose, I am sure that your custom icon is set. But still if your icon seems to be the same, then,
@parasuraam You may also need to refresh your icon cache.
when I build JPackage in linux. it comes jpackage failed
How can I solve this error?