xinyingho / Negatron

Negatron, an intuitive front-end for MAME, the well known video game emulator.
GNU General Public License v3.0
22 stars 2 forks source link

Small improvement of the Negatron.sh file so that it works when we add this app to our PATH #1

Open jmarunix opened 3 years ago

jmarunix commented 3 years ago

Hi, first of all congratulations on this project, it is fantastic.

I use Fedora Linux and when I install the directory of your app in my PATH it gives me the following execution error:

Exception in Preloader start method java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464) at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051) Caused by: java.lang.RuntimeException: Exception in Preloader start method at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:882) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.util.MissingResourceException: Can't find bundle for base name net.babelsoft.negatron.preloader.LanguageUi, locale es_ES at java.base/java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:2055) at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1689) at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1582) at java.base/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1556) at java.base/java.util.ResourceBundle.getBundle(ResourceBundle.java:857) at negatron.preloader@0.100.1/net.babelsoft.negatron.preloader.Language.getBundle(Language.java:35) at negatron.preloader@0.100.1/net.babelsoft.negatron.preloader.NegatronPreloader.start(NegatronPreloader.java:139) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$7(LauncherImpl.java:768) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277) ... 1 more Exception running application net.babelsoft.negatron.NegatronApp

The change that I propose you in the Negatron.sh file is the following, in the first line instead of

 DIR=`dirname $0`

include

DIR=`whereis $0 | sed  's/ /\n/g' | grep sh | sed 's/\/Negatron.sh//'` && cd $DIR

I think this execution is more convenient considering that your app needs java libraries from the modules and modules/lnx subdirectories

xinyingho commented 3 years ago

I'm not sure to understand what you mean by "when I install the directory of your app in my PATH". I'm not an advanced user of Linux as I mainly develop on Windows. I do understand what your code does, it's just that I don't understand in which context you need to do this.

Negatron.sh is supposed to be used like this: after unzipping the downloaded Negatron file somewhere, you go into the unzipped folder and double-click on Negatron.sh to launch the app.

I guess that I really don't know how you install anything in Linux to get some answers with the command "whereis" and how you launch Negatron.sh without being in the actual folder.