Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

This is not an issue that is directly related to Forge, but it is something someone here might be able to help me with.

 

When we updated our mod to 1.7.10, we noticed some people started having issues with running our content scripts which we use for mob drops and some other things. Well, now, it is happening to everything. I am pretty sure now that everyone is on Java 8, it does not work for anyone. It does not even work in our dev environment anymore for intelliJ.

 

This is the code that is messing up and it seems that it is a pretty standard way of doing things. "getEngineByName" is returning null which is only support to happen if that Engine does not exist. Except JavaScript should exist.

 

import javax.script.*;
new ScriptEngineManager().getEngineByName("JavaScript");

 

UPDATE: After a lot more research, it looks like in Java 8 that nashorn.jar, which contains the JavaScript engine, is a Java Extension and it is not being loaded by the Minecraft Launcher. Does anyone know how to force load this extension using either Gradle or the code or something else? The mod is being built with JDK8 targeting JRE 8. If I load it inside of IntelliJ it all works fine, it is simply because the extension is not being loaded by the launcher.

  • Author

It looks like it is a classpath issue. It was not set up right. I finally got it working now though. Thanks guys!

  • Author

Yeah, nashorn is definitely there. I am pretty sure the Minecraft launcher it just not loading it. I know you can do classpath injection, but I do not really know how. Can I force Java to load it somehow?

  • Author

It looks like it might be modloader that is causing the issue.

 

The following code works in Java 7 in both IntelliJ AND Minecraft, whereas in Java 8, it only works in IntelliJ

import javax.script.*;
new ScriptEngineManager().getEngineByName("JavaScript");

 

However, if I tell ScriptEngineManager to use the Forge Mod Loader, it only works in Java 7 and no longer in Java 8 at all.

 

import cpw.mods.fml.common.Loader;
import javax.script.*;
new ScriptEngineManager(Loader.instance().getModClassLoader()).getEngineByName("JavaScript");

 

 

In Java 7, rhino.jar is located inside of JRE\lib, in Java 8, nashorn.jar is located in JRE\lib\ext. It looks like Forge is not loading the Java extension Jars.

  • Author

In that case, is it possible to get Forge to load a jar from a Maven repo if it cannot find it?

 

i.e. Can I upload and host a copy of rhino.jar that it needs to use Rhino and make it so Forge will download and use it if it is on Java 8+?

  • Author

I just determined it is not. Forge is not loading it. Nashorn is a Java Extension and it is not loading it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.