Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Linux Programming
  4. Opening JavaFX jar on Ubuntu [SOLVED]

Opening JavaFX jar on Ubuntu [SOLVED]

Scheduled Pinned Locked Moved Linux Programming
linuxjavahelpquestionlearning
11 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Valentinor
    wrote on last edited by
    #1

    I've created a JavaFX project, and exported it as Runnable Jar (with Eclipse). On Windows it works just fine, it opens up, and it does everything I made it do. The problem is when I try to run it on Ubuntu, it doesn't show up. I'm running it with OpenJDK 8. I've already give it permission to run that file (from properties). Is there something else I need to do (add some code, manifest, or something else), to make it show up on Ubuntu? (I have Wine installed too). By show up, I mean of course the GUI I made. /Solution: I've uninstalled java completely and then installed and set it manually. Downloaded: Java SE Development Kit 8 / file: jdk-8u211-linux-x64.tar.gz

    L 1 Reply Last reply
    0
    • V Valentinor

      I've created a JavaFX project, and exported it as Runnable Jar (with Eclipse). On Windows it works just fine, it opens up, and it does everything I made it do. The problem is when I try to run it on Ubuntu, it doesn't show up. I'm running it with OpenJDK 8. I've already give it permission to run that file (from properties). Is there something else I need to do (add some code, manifest, or something else), to make it show up on Ubuntu? (I have Wine installed too). By show up, I mean of course the GUI I made. /Solution: I've uninstalled java completely and then installed and set it manually. Downloaded: Java SE Development Kit 8 / file: jdk-8u211-linux-x64.tar.gz

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I have just tried running a jar file, made under Windows, on Ubuntu, and it works fine. Admittedly is does not use JavaFX or OpenJDK (whatever that is).

      V 1 Reply Last reply
      0
      • L Lost User

        I have just tried running a jar file, made under Windows, on Ubuntu, and it works fine. Admittedly is does not use JavaFX or OpenJDK (whatever that is).

        V Offline
        V Offline
        Valentinor
        wrote on last edited by
        #3

        JavaFX part is actually what I need. If I'm running a simple jar (from console with java -jar Name.jar), it works fine, but the jar that has JavaFX doesn't work. If I simply try to run it directly with OpenJDK 8 Runtime, nothing shows up, but if I try to run the jar from console, I get the error "Error: Could not find or load main class package.Name", even tho it has the MANIFEST.MT generated in it by Eclipse with "Main-Class:", and the actual class too. Both projects exported the same way, both tested on Windows and working just fine, the only problem being that the one that is important (with JavaFX as GUI), doesn't work.

        L 1 Reply Last reply
        0
        • V Valentinor

          JavaFX part is actually what I need. If I'm running a simple jar (from console with java -jar Name.jar), it works fine, but the jar that has JavaFX doesn't work. If I simply try to run it directly with OpenJDK 8 Runtime, nothing shows up, but if I try to run the jar from console, I get the error "Error: Could not find or load main class package.Name", even tho it has the MANIFEST.MT generated in it by Eclipse with "Main-Class:", and the actual class too. Both projects exported the same way, both tested on Windows and working just fine, the only problem being that the one that is important (with JavaFX as GUI), doesn't work.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Sorry, but it's impossible to guess what is wrong. The error message suggest that your jar file is corrupt. You can unzip it with the jar -x command and check its contents.

          V 1 Reply Last reply
          0
          • L Lost User

            Sorry, but it's impossible to guess what is wrong. The error message suggest that your jar file is corrupt. You can unzip it with the jar -x command and check its contents.

            V Offline
            V Offline
            Valentinor
            wrote on last edited by
            #5

            The jar isn't corrupted, as I said on Windows it is working fine. From what I read, the problem is JavaFX, you need to do something else to be able to run a project with it on Ubuntu, but so far I haven't managed to make it work. /EDIT: I've added the project in Eclipse/Ubuntu, and it it working fine if I run it though Eclipse. Then I exported the project again as Runnable jar from Eclipse/Ubuntu and I have the same problem.

            L 1 Reply Last reply
            0
            • V Valentinor

              The jar isn't corrupted, as I said on Windows it is working fine. From what I read, the problem is JavaFX, you need to do something else to be able to run a project with it on Ubuntu, but so far I haven't managed to make it work. /EDIT: I've added the project in Eclipse/Ubuntu, and it it working fine if I run it though Eclipse. Then I exported the project again as Runnable jar from Eclipse/Ubuntu and I have the same problem.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              javafx ubuntu - Google Search[^]

              V 1 Reply Last reply
              0
              • L Lost User

                javafx ubuntu - Google Search[^]

                V Offline
                V Offline
                Valentinor
                wrote on last edited by
                #7

                That was the first thing I've done, but what all of those failed to mention, is that you need to install manually "Java SE Development Kit 8" in order to make JavaFX work.

                L 1 Reply Last reply
                0
                • V Valentinor

                  That was the first thing I've done, but what all of those failed to mention, is that you need to install manually "Java SE Development Kit 8" in order to make JavaFX work.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  That is mentioned in the first item returned by Google.

                  V 1 Reply Last reply
                  0
                  • L Lost User

                    That is mentioned in the first item returned by Google.

                    V Offline
                    V Offline
                    Valentinor
                    wrote on last edited by
                    #9

                    The order depends on what server you are using, so your first might me on 3rd page for me for example.

                    L 1 Reply Last reply
                    0
                    • V Valentinor

                      The order depends on what server you are using, so your first might me on 3rd page for me for example.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      This one (on Ask Ubuntu) java - JavaFX missing, Ubuntu 18.04 - Ask Ubuntu[^]

                      V 1 Reply Last reply
                      0
                      • L Lost User

                        This one (on Ask Ubuntu) java - JavaFX missing, Ubuntu 18.04 - Ask Ubuntu[^]

                        V Offline
                        V Offline
                        Valentinor
                        wrote on last edited by
                        #11

                        As I said, it didn't work using the command to get java, I had to manually take it from Oracle, and install it that way. And from Oracle, I didn't had to download openjfx separately (which still didn't worked that way), it came with jdk 8_211.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups