Troubleshooting Developer - TheShubham99/Terasology GitHub Wiki
IntelliJ
- Be sure to open an existing project and use project files generated with
gradlew idea
- importing via Gradle or other options can leave you with broken project config at worst and missing a bunch of utility at least. - For a first time install of IntelliJ you may not have a defined JDK available at a platform level. Look at
File -> Project Structure -> SDKs
and use the green + if needed to point to a local JDK 8. If not you may get errors about basic Java language features missing- After setting this up or if you name your JDK 8 something other than the default "1.8" you may have to set that to the Project SDK, again on the Project Structure page
- Any time you change the overall project structure by adding/deleting modules or pull updates from elsewhere that contain library changes you may have to run
gradlew idea
again to refresh your project config and get new dependencies.
Java
- It can be tricky to make sure the right version of Java is being used in different situations (within an IDE, via command line, on a server ..) - check the following options if needed:
- System
JAVA_HOME
environment variable - System
PATH
environment variable - The
update-alternatives
orupdate-java-alternatives
commands available on some Linux systems can override what's set viaJAVA_HOME
. See this Ask Ubuntu thread or check Google.
- System
- The Java installation picker (which download you get from https://www.java.com/en/download) may give you a 32-bit installer if you're using a 32-bit browser on a 64-bit system. Use 64-bit if you can!
- Use
java -version
to find out what you have. This in turn may also depend on your OS. For instance, Windows may default a command prompt toC:\Windows\System32
which will give you bad info. Try fromC:\
or anywhere else instead. - The 64-bit version explicitly states it is 64-bit (like
64-Bit Server VM
) where 32-bit may call itself something likeClient VM
- Use
- If you do development and have something like Android Studio installed you may have had your system classpath modified. This can cause trouble if a system version of some Java dependency gets used in favor of a version we bundle.
- Example: If you get an error like
Caused by: java.lang.UnsatisfiedLinkError: Can't obtain static method fromNative(Method, Object) from class com.sun.jna.Native
then try running the game withjava -Djna.nosys=true -jar libs/Terasology.jar -homedir
to ignore the system-provided version of JNA
- Example: If you get an error like
Linux
- Watch out for line-ending issues. For instance, the
gradlew
script might throw an error likebash: ./gradlew: /bin/bash^M: bad interpreter: No such file or directory
if it somehow ends up with Windows-style line endings. - If having issues with SSL when using
gradlew
, runupdate-ca-certificates -f
as root (or usingsudo
). - If xrandr is being used to set a custom resolution, the game could possibly crash on launch due to lwjgl's xrandr configuration parsing. To fix, make sure the configuration mode name follows the format
"3000x2000"
instead of"3000x2000_60.00"
or"3000by2000"
.
Arch/Gentoo random problems
Both Arch and Gentoo do not include java jfx (needed for the launcher) by default when installing java.
On Arch you need to install the java-openjfx
package, and on Gentoo you need to use the javafx
USE flag when compiling java.
xrandr is a generic linux dependency for terasology, but the cases where you have it uninstalled usually only happen on arch and gentoo.
Windows
It is possible to end up getting Gradle into a fight with the Windows specific Thumbs.db
files. If it is not an option to disable the generation of these files (relates to icon previewing) or even once after it is disabled you can clean a directory and its subdirs with one of the following commands:
del /s /q /f /a:h Thumbs.db
while in the top-level directory in a plain command promptGet-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force | Remove-Item -Force
likewise, with Powershell
Solutions sourced from https://github.com/MarcusBarnes/mik/wiki/Cookbook:-Removing-.Thumbs.db-files-from-a-directory