yetanotherbot 4 Share Posted April 10, 2020 I'm using a dependency (gson) which has a module-info. Script manager hits an expection when enumerating scripts and the script never shows up. The problem only seems to be with finding the scripts, not running them. Scenario 1: Build script without dependency Launch DreamBot and open script manager Script is found With script manager still open, rebuild script jar with dependencies Script manager throws a bunch of errors but the script is still listed Script can be started and works as expected including dependency calls Scenario 2: Build script with dependency Launch DreamBot and open script manager Exceptions throw. Script manager broken. No script found. At this stage, recompiling without dependency or closing script manager has no effect. Client restart needed. Both scenarios throw this error: java.lang.UnsupportedClassVersionError: module-info has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0. Only Scenario 2 throws: java.lang.NoClassDefFoundError: Could not initialize class org.dreambot.api.script.loader.LocalLoader Can anyone point me in the right direction here? Thanks Link to comment Share on other sites More sharing options...
Articron 737 Share Posted April 10, 2020 Pack the classes from your dependency into your script itself, that way you're compiling it with Java 8. Link to comment Share on other sites More sharing options...
yeeter 490 Share Posted April 10, 2020 Maven can be nice for automatically packing deps with your jars Link to comment Share on other sites More sharing options...
yetanotherbot 4 Author Share Posted April 10, 2020 Thanks both for replies. What I've done so far is downloaded the source for gson, deleted the manifest-info, and recompiled. That works but it feels complicated, esp if it wasn't open source. @Articron Link to comment Share on other sites More sharing options...
yetanotherbot 4 Author Share Posted April 10, 2020 @Articron I have under Artifacts added 'extracted gson.2.8.6-db' and under modules ticked the library with scope compile. Is this what you mean or something else? I think IntelliJ is ignoring the module-info file for java <9 and so it never gets rebuilt. Just a thought. @yeeter01 will have a read through that, thanks! Link to comment Share on other sites More sharing options...
yetanotherbot 4 Author Share Posted April 10, 2020 Just to follow up and say building with maven did the trick. Much better way of doing things than project settings > artifacts Thanks all Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now