SvenKayser / JMOD

The Javascript MOD Loader
Other
9 stars 4 forks source link

Bug when running on JRE 8u45 #38

Closed nmarshall23 closed 7 years ago

nmarshall23 commented 8 years ago

After merging with the master branch I get a JMODLoader warning, Failed to parse JSON from.

I've debuged it to a Nashorn exception: TypeError: Cannot call undefined in <eval>, in LoaderUtil.parseModJson(rawjson);

After a lot of googling, this looks like a bug in JRE 8u45. From http://www.oracle.com/technetwork/java/javase/8u45-relnotes-2494160.html

Nashorn has known issues where it incorrectly compiles try/finally constructs.

The release notes for JRE 8u60 say that bug was fixed.

I can confirm that do not have any issues on JRE 8u111. My desktop and laptop have no issues, it's my hosted server that so far is resisting updating their JRE. They are running JRE 8u45.

Take a look at the published workarounds.

I think we should try and use the workarounds as most people don't look at the minor version numbers.

SvenKayser commented 7 years ago

The fix for this poses other problems. Iirc you cannot use comments with Gson, which is the original reason I dropped it for parsing the json files.

SvenKayser commented 7 years ago

I guess I'll implement manual removal of comments and switch (back) to GSON after that. The problem is that https://github.com/google/gson/issues/212 wasn't fixed in GSON 2.2.4 yet.

SvenKayser commented 7 years ago

Resolved as of https://github.com/SvenKayser/JMOD/commit/1aa09504fba61e83598793371c5e720fbca29baf