hex007 / freej2me

A free J2ME emulator with libretro, awt and sdl2 frontends.
Other
469 stars 72 forks source link

attempt "file:///" in case of error #209

Open testman42 opened 6 months ago

testman42 commented 6 months ago

when running from command line (in Linux), doing just

> freej2me file.jar

results in error:

no protocol: /path/to/file.jar
java.net.MalformedURLException: no protocol: /path/to/file.jar
    at java.base/java.net.URL.<init>(Unknown Source)
    at java.base/java.net.URL.<init>(Unknown Source)
    at java.base/java.net.URL.<init>(Unknown Source)
    at org.recompile.mobile.MobilePlatform.loadJar(MobilePlatform.java:154)
    at org.recompile.freej2me.FreeJ2ME.<init>(FreeJ2ME.java:186)
    at org.recompile.freej2me.FreeJ2ME.main(FreeJ2ME.java:36)
Couldn't load jar...

after digging a lot, I found out that the way to load .jar is to do the following:

> freej2me "file:///$PWD/file.jar"

at least it works in fish shell so not only does the protocol have to be defined (as file:///), but also absolute path to the file has to be given

this is something that should be automatically attempted before showing the error to the user

testman42 commented 6 months ago

Ah, apparently I made a duplicate of the currently last post in #169 Which I would have found sooner if that issue was not instantly de-railed into offtopic :roll_eyes: