-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NullPointerException: ... because "environment" is null #698
Comments
|
This error is likely the cause. It's a known issue and usually happens with Java versions above 17. The exception is thrown because A workaround is something along the lines of the following in if (Runtime.version().feature() < 18 || "allow".equals(System.getProperty("java.security.manager"))) {
Policy.setPolicy(new ModuleSecurityPolicy());
System.setSecurityManager(new ModuleSecurityManager());
} else {
logger.warn("SecurityManager is disabled starting with Java 18 - module sandbox functionality is limited!");
logger.warn("To enable SecurityManager, use the \"-Djava.security.manager=allow\" JVM option.");
} Although with that nix-shell environment you should be using Java 11 already. What output do you see from running the |
Ah, I forgot to mention that I installed OpenJDK 19 instead, that's what I were running at that time. |
Where do you place it? |
Did you find a solution for this? I had meant to get back to this but temporarily forgot for a time. |
I tried pasting snippet code at ModuleManager.java:284. It failed to build. I know that DS is supposed to be run in jdk11, but I wanted to test whether it runs faster in newer versions. |
The changes in BenjaminAmos@fdeced3 should work. We are unable to use the |
Thank you. |
Is it showing the same error as before on Java 21? I tested a distribution build under Java 21 and it appeared to work. Running |
No, only happens on Java 21.
|
If you change the gradle version used:
to https\://services.gradle.org/distributions/gradle-8.4-all.zip Does it help at all? |
Hi. I have this problem now, it's making it difficult to keep developing. |
Yes, it seems so. I don't see the "Error: Gradle Build Failed" message again. |
I tend to use IntelliJ Idea personally, so the most I know is that your issue looks a bit like microsoft/vscode-gradle#1431 and it might be worth disabling the |
It worked! Thank you! |
What you were trying to do
I was trying to run the game as follows:
What actually happened
How to reproduce
No response
Game version
2.1.0 (develop branch)
Log details
Operating System
Linux
Additional Info
I use NixOS.
Here is the
shell.nix
where I usually run DS:I was able to run the game exactly as I tried today. It's a fresh clone, no changes, just the source code as it is in this repository; however, it didn't work this time.
The text was updated successfully, but these errors were encountered: