Code Monkey home page Code Monkey logo

Comments (8)

Xemiru avatar Xemiru commented on July 25, 2024

https://github.com/libgdx/packr/blob/master/src/main/native/packr/src/packr.cpp#L561

I don't know C++, but I'd assume this is around where the issue is, as it terminates when the main method closes and not when all non-daemon threads are dead. This, however, doesn't explain the line directly after invoking launch not running.

from packr.

code-disaster avatar code-disaster commented on July 25, 2024

I never used JavaFX, but the Application class does a lot of reflection work. Maybe try to try {} catch {} everything and see if there's an unhandled exception slipping through.

Also, I believe a call to System.exit() causes the main() to not return properly as well.

from packr.

Xemiru avatar Xemiru commented on July 25, 2024

It's throwing a ClassNotFoundException over the DesktopLauncher class.

Which doesn't make sense, since the main method lives inside that class; it shouldn't even need to ask for it. The program otherwise works perfectly fine outside of packr's executable, making it to the game's launcher window.

Invoking static me.scarlet.undertailor.desktop.DesktopLauncher.main() function ...
test0test1
java.lang.RuntimeException: java.lang.ClassNotFoundException: me.scarlet.undertailor.desktop.DesktopLauncher
        at javafx.application.Application.launch(Application.java:260)
        at me.scarlet.undertailor.DesktopLauncher.main(DesktopLauncher.java:78)
Caused by: java.lang.ClassNotFoundException: me.scarlet.undertailor.desktop.DesktopLauncher
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at javafx.application.Application.launch(Application.java:248)
        ... 1 more
test2
Destroyed Java VM ...
Press ENTER key to exit.

Other weird behavior is that it doesn't print out the exception if I redirected output to a text file.

from packr.

Xemiru avatar Xemiru commented on July 25, 2024

@code-disaster It's still very odd that this occurs, luckily the launch method has alternate parameters where I can specify the DesktopLauncher class. I'll leave this issue open as this seems to be local to packr only.

// fix
Application.launch(DesktopLauncher.class, args);

from packr.

shaigem avatar shaigem commented on July 25, 2024

@code-disaster The same issue still occurs in version 2.0 even with the fix that @Xemiru mentioned.

public static void main(String[] args) {
        System.out.println("hello world 1");
        try {
            Application.launch(JavaFXApp.class, args);
            System.out.println("hello world 2");

        } catch (Exception ex) {
            ex.printStackTrace();
        }
        System.out.println("hello world 3");
    }

Only `hello world 1` gets outputted and the application just exits.
No exceptions occur either.

from packr.

guy-keller avatar guy-keller commented on July 25, 2024

I have too faced the same issue as mentioned by the others when distributing an app that uses Java FX.

To get around this issue, I created a bash script that unzips the JDK and puts the JRE in a specific folder.
As a workaround to start the app I created a: .command, .bat, .sh - it is not pretty but it works.

@code-disaster - A suggestion would be to have a minimizeJre='skip' and distribute the JRE in full.

from packr.

code-disaster avatar code-disaster commented on July 25, 2024

@guikeller if you omit the minimizeJre parameter, minimize is skipped. Also, this seems like a different issue, since @Xemiru wrote that he tried with a unminified Oracle JRE.

from packr.

karlsabo avatar karlsabo commented on July 25, 2024

Please try the latest version of packr and open a new issue if there is a problem.

Thanks.

from packr.

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.