Comments (15)
java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release at java.base/java.lang.System.setSecurityManager(System.java:425) at org.destinationsol.modules.ModuleManager.loadEnvironment(ModuleManager.java:281) at org.destinationsol.modules.ModuleManager.init(ModuleManager.java:248) at org.destinationsol.SolApplication.create(SolApplication.java:158) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.initializeListener(Lwjgl3Window.java:416) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:366) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:193) at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:167) at org.destinationsol.desktop.SolDesktop.main(SolDesktop.java:138)
This error is likely the cause. It's a known issue and usually happens with Java versions above 17. The exception is thrown because SecurityManager
is deprecated for removal. Since the game typically runs with Java 11 this is not usually encountered.
A workaround is something along the lines of the following in ModuleManager
, which I will try and add soon:
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 java -version
command in that shell?
from destinationsol.
The changes in BenjaminAmos@fdeced3 should work. We are unable to use the Runtime
class yet because the code is still compiled against Java 8 for Android runtime compatibility. This means that we are limited to the APIs available in Java 8, even if the game is unable to actually run on Java 8 anymore.
from destinationsol.
$ ./gradlew run
Configuration on demand is an incubating feature.
Module modules:core has a build file so counting it complete and including it
> Task :build-logic:extractPluginRequests UP-TO-DATE
> Task :build-logic:generatePluginAdapters UP-TO-DATE
> Task :build-logic:compileJava UP-TO-DATE
> Task :build-logic:compileGroovy NO-SOURCE
> Task :build-logic:compileGroovyPlugins UP-TO-DATE
> Task :build-logic:pluginDescriptors UP-TO-DATE
> Task :build-logic:processResources UP-TO-DATE
> Task :build-logic:classes UP-TO-DATE
> Task :build-logic:jar UP-TO-DATE
> Task :engine:compileJava UP-TO-DATE
> Task :desktop:compileJava UP-TO-DATE
> Task :desktop:processResources UP-TO-DATE
> Task :desktop:classes UP-TO-DATE
> Task :engine:processResources UP-TO-DATE
> Task :engine:classes UP-TO-DATE
> Task :engine:jar UP-TO-DATE
> Task :desktop:run
INFO [main] (ModulePathScanner.java:110) - Discovered module: core-2.1.0
java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
at java.base/java.lang.System.setSecurityManager(System.java:425)
at org.destinationsol.modules.ModuleManager.loadEnvironment(ModuleManager.java:281)
at org.destinationsol.modules.ModuleManager.init(ModuleManager.java:248)
at org.destinationsol.SolApplication.create(SolApplication.java:158)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.initializeListener(Lwjgl3Window.java:416)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:366)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:193)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:167)
at org.destinationsol.desktop.SolDesktop.main(SolDesktop.java:138)
ERROR [main] (SolApplication.java:160) - Cannot initialize modules
ERROR [main] (SolDesktop.java:179) - This exception was not caught:
java.lang.NullPointerException: Cannot invoke "org.terasology.gestalt.module.ModuleEnvironment.getSubtypesOf(java.lang.Class, java.util.function.Predicate)" because "environment" is null
at org.terasology.gestalt.entitysystem.component.management.ComponentTypeIndex.changeEnvironment(ComponentTypeIndex.java:84)
at org.terasology.gestalt.entitysystem.component.management.ComponentTypeIndex.<init>(ComponentTypeIndex.java:67)
at org.destinationsol.assets.AssetHelper.init(AssetHelper.java:82)
at org.destinationsol.SolApplication.create(SolApplication.java:164)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.initializeListener(Lwjgl3Window.java:416)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:366)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:193)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:167)
at org.destinationsol.desktop.SolDesktop.main(SolDesktop.java:138)
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.6/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 17s
13 actionable tasks: 1 executed, 12 up-to-date
from destinationsol.
Although with that nix-shell environment you should be using Java 11 already. What output do you see from running the
java -version
command in that shell?
Ah, I forgot to mention that I installed OpenJDK 19 instead, that's what I were running at that time.
from destinationsol.
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."); }
DestinationSol/engine/src/main/java/org/destinationsol/modules/ModuleManager.java:284: error: cannot find symbol
if (Runtime.version().feature() < 18 || "allow".equals(System.getProperty("java.security.manager"))) {
^
symbol: method version()
location: class Runtime
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
6 warnings
Where do you place it?
from destinationsol.
Did you find a solution for this? I had meant to get back to this but temporarily forgot for a time.
from destinationsol.
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.
from destinationsol.
Thank you. fdeced3
didn't work on Java 21, but worked on Java 17.
from destinationsol.
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 ./gradlew run
might be more problematic though since the version of Gradle we currently use doesn't support Java 21 (it supports Java 19 at most). Upgrading Gradle is not currently planned since I need to co-ordinate it with also upgrading the Android gradle plugin at the same time, which would necessitate a move to Java 17.
from destinationsol.
Is it showing the same error as before on Java 21? I tested a distribution build under Java 21 and it appeared to work.
No, only happens on Java 21.
[info] Java Home: /nix/store/4v41d9wyc4n4idvcx5fa7vpbnqp14ccz-temurin-bin-21.0.1
[info] JVM Args: --add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xms128m,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant
[info] Gradle User Home: /home/user/.gradle
[info] Gradle Version: 7.6
[info] Module modules:core has a build file so counting it complete and including it
Module modules:pirates has a build file so counting it complete and including it
> Task :build-logic:extractPluginRequests UP-TO-DATE
> Task :build-logic:generatePluginAdapters UP-TO-DATE
> Task :build-logic:compileJava UP-TO-DATE
> Task :build-logic:compileGroovy NO-SOURCE
> Task :build-logic:compileGroovyPlugins FAILED
[error] FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':build-logic:compileGroovyPlugins'.
> BUG! exception in phase 'semantic analysis' in source unit 'precompiled_DestinationSolIde' Unsupported class file major version 65
from destinationsol.
If you change the gradle version used:
to
https\://services.gradle.org/distributions/gradle-8.4-all.zip
Does it help at all?
from destinationsol.
Hi. I have this problem now, it's making it difficult to keep developing.
redhat-developer/vscode-java#3449 (comment)
Please help.
from destinationsol.
If you change the gradle version used:
to
https\://services.gradle.org/distributions/gradle-8.4-all.zipDoes it help at all?
Yes, it seems so. I don't see the "Error: Gradle Build Failed" message again.
from destinationsol.
Hi. I have this problem now, it's making it difficult to keep developing. redhat-developer/vscode-java#3449 (comment) Please help.
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 Gradle for Java
extension. You might have to get used to running ./gradlew run
whenever you want to test the game otherwise.
from destinationsol.
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
Gradle for Java
extension. You might have to get used to running./gradlew run
whenever you want to test the game otherwise.
It worked! Thank you!
from destinationsol.
Related Issues (20)
- Zoom In/Out does not work with mouse scroll on map screen
- Opening map causes camera to zoom out HOT 5
- Improve in-game tutorial
- Adapt existing UI screens to use NUI
- Weapons failing to fire. HOT 5
- Sound Volume Button changes the volume of Music
- Wormholes grab trading posts and drag them away from planets HOT 4
- Follow-ups for Gestalt-DI HOT 1
- form bearkilla HOT 2
- Miner knockback ability is too powerful HOT 2
- Release 2.1.0 HOT 1
- Game crashes on startup on M2 mac HOT 8
- Tutorial Waypoint crash HOT 1
- Gradle sync failed: Could not GET 'http://.../cr-destsol-4.0.0.pom' 502 Bad Gateway HOT 12
- No sound at all HOT 7
- Game crashes by fatal error: SIGSEGV (0xb) when the hero is fighting on a planet HOT 2
- Unable to run the Physics Body Editor, due to missing libraries HOT 4
- `W: An illegal reflective access operation has occurred` when creating a module. HOT 2
- Starting a tutorial overwrites main game save data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from destinationsol.