Repository navigation
Description
Documentation Topic
As of #5162 being merged, Terasology now uses Java 17 for compilation. Whilst some documentation has been updated for this, there is likely more still that references Java 11 in places.
After pulling in 3aa68c0, or with a fresh clone, you will need a Java 17 JDK to build and run the game. JDK 17 can be obtained from many sources. I personally find that the Eclipse Termurin (formerly AdoptOpenJDK) distribution tends to work.
If you are seeing errors like the following then you are probably still using JDK 11. You need to update to JDK 17 to fix this (make sure to update the JAVA_HOME environment variable as well).
A problem occurred configuring root project 'Terasology'.
> Could not determine the dependencies of null.
> Could not resolve all task dependencies for configuration ':classpath'.
> Could not resolve org.terasology.gradology:build-logic.
Required by:
project :
> No matching variant of project :build-logic was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.4' but:
- Variant 'apiElements' capability org.terasology.gradology:build-logic:unspecified declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.4')
- Variant 'mainSourceElements' capability org.terasology.gradology:build-logic:unspecified declares a component, and its dependencies declared externally:
- Incompatible because this component declares a component of category 'verification' and the consumer needed a library
- Other compatible attributes:
- Doesn't say anything about its target Java version (required compatibility with Java 11)
- Doesn't say anything about its elements (required them packaged as a jar)
- Doesn't say anything about org.gradle.plugin.api-version (required '8.4')
- Doesn't say anything about its usage (required runtime)
You may also see the following warning. We're aware of it and it is unlikely to be resolved soon. The game depends on SecurityManager as a part of module sandboxing.
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.terasology.engine.core.module.ModuleManager (file:/engine/build/libs/engine-5.4.0-SNAPSHOT.jar)
WARNING: Please consider reporting this to the maintainers of org.terasology.engine.core.module.ModuleManager
WARNING: System::setSecurityManager will be removed in a future release
Documentation Type
Terasology Knowledge Base
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
BenjaminAmos commentedon Nov 17, 2023
@soloturn @PurityLake @lokytech5 @jdrueckert @skaldarnar - this might affect you.
jdrueckert commentedon Nov 18, 2023
Provided @skaldarnar and I write a milestone summary blogpost again, that's definitely going in there in bold 😅
soloturn commentedon Nov 18, 2023
thanks for the heads up @BenjaminAmos ! as i never have a JAVA_HOME set i am wondering why you recommend to do so for terasology?
BenjaminAmos commentedon Nov 18, 2023
I did not intend to recommend it, just to advise that the variable should be changed if it exists. When working with multiple Java versions, setting the
JAVA_HOMEenvironment variable can be an easy way to switch between versions. Certain tools used to depend on the presence of the variable to identify where Java was installed. Most of the time having the right java install directory in your system path (thePATHenvironment variable) works the same..lokytech5 commentedon Nov 19, 2023
May I know the actual Java version to set in JAVA_HOME?
BenjaminAmos commentedon Nov 19, 2023
If you have a
JAVA_HOMEenvironment variable set then you should change it to the location that Java 17 is installed in. For example, on Windows it might be installed inC:\Program Files\Eclipse Adoptium\jdk-17.0.8.101-hotspot. If you don't have that environment variable present then you do not need to do anything with it.lokytech5 commentedon Dec 6, 2023
ok noted
soloturn commentedon Dec 28, 2023
@BenjaminAmos , when exiting the game using "josharias survival" i get the following error:
BenjaminAmos commentedon Jan 2, 2024
There is likely a component somewhere that contains a
java.lang.Classfield within it. This does look like a Java 17 issue though.I think this might have been related to
RetainComponentsComponentwhen I last checked.soloturn commentedon Mar 11, 2024
nothing known which is open.