beryx-gist / badass-runtime-example-javafx

A small JavaFX application that shows how to use the Badass Runtime Plugin
Apache License 2.0
25 stars 3 forks source link

Invalid or unsupported type: [rpm] #17

Closed ghost closed 3 years ago

ghost commented 4 years ago

when I build JPackage in linux. it comes jpackage failed

How can I solve this error?

Srijan-Sengupta commented 4 years ago

On Linux, such errors are common when your linux-destro does not support rpm type of packaging.

Srijan-Sengupta commented 4 years ago

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.

Srijan-Sengupta commented 4 years ago

Launch the application from the terminal by the command: /opt/hellofx/bin/hellofx

And see if any error comes.

Srijan-Sengupta commented 4 years ago

Then the following issues may be responsible:

  1. The launcher file of linux (.desktop) is missing which is the desktop configuring file used to launch an application.
  2. The .desktop file is not correctly configured
  3. Or there may be some other path issue(s).

It would be better if you would provide the build.gradle file.

Srijan-Sengupta commented 4 years ago

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'] } .. } .. }

Srijan-Sengupta commented 4 years ago

But still if you want to configure yourself for more perfection, you may contact me and I will help you out.

Srijan-Sengupta commented 4 years ago

Please see this

Srijan-Sengupta commented 4 years ago

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

Srijan-Sengupta commented 4 years ago

Please place the $project.root/src/main/resources in double quotation(")

Srijan-Sengupta commented 4 years ago

Replace "$project.root/src/main/resources" with "--resource-dir" and "build/jpackage/hellofx/lib" with "$project.root/src/main/resources"

Srijan-Sengupta commented 4 years ago

Replace "$project.rootDir/src/main/resources" with "--resource-dir"

Srijan-Sengupta commented 4 years ago

first one only

Srijan-Sengupta commented 4 years ago

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'] } } }

Srijan-Sengupta commented 4 years ago

What is the name of your project and the package?

Srijan-Sengupta commented 4 years ago

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 .

Srijan-Sengupta commented 4 years ago

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.

  1. open a terminal and navigate to your project directory.
  2. Run ./gradlew -i clean jpackage
  3. Copy the output in the terminal and paste in a file.
  4. Show the file so that I can find out the reason why it is not taking up your Icon.
Srijan-Sengupta commented 4 years ago

Yes @parasuraam , it will work for any linux os of the architecture, amd64.

Srijan-Sengupta commented 4 years ago

when I execute this ./gradlew -i clean jpackage command . it comes like this

per

For this problem, you will have to run chmod +x gradlew in that directory and hit enter and run the command again.

Srijan-Sengupta commented 4 years ago

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.

Srijan-Sengupta commented 4 years ago

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

Srijan-Sengupta commented 4 years ago

Please download the .deb file

Srijan-Sengupta commented 4 years ago

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'] } } }

Srijan-Sengupta commented 4 years ago

Then sync in the Intellij IDE and in Terminal do the same.

Srijan-Sengupta commented 4 years ago

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,

  1. remove all the older packages which were installed earlier.
  2. then restart your computer(virtual box), and make sure that PCOID application is not present.
  3. Run jpackage.
  4. Lastly reinstall that package. And let me know.
siordache commented 4 years ago

@parasuraam You may also need to refresh your icon cache.