Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Locale;
import java.util.OptionalLong;
Expand All @@ -48,6 +50,7 @@ public static void verifyJvmRequirements()
verifyUsingG1Gc();
verifyFileDescriptor();
verifySlice();
verifyUtf8();
}

private static void verify64BitJvm()
Expand Down Expand Up @@ -150,6 +153,14 @@ private static void verifySlice()
}
}

private static void verifyUtf8()
{
Charset defaultCharset = Charset.defaultCharset();
if (!defaultCharset.equals(StandardCharsets.UTF_8)) {
failRequirement("Trino requires that the default charset is UTF-8 (found %s). This can be set with the JVM command line option -Dfile.encoding=UTF-8", defaultCharset.name());
}
}

/**
* Perform a sanity check to make sure that the year is reasonably current, to guard against
* issues in third party libraries.
Expand Down
5 changes: 5 additions & 0 deletions docs/src/main/sphinx/installation/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ as the JDK for Trino, as Trino is tested against that distribution.
Zulu is also the JDK used by the
[Trino Docker image](https://hub.docker.com/r/trinodb/trino).

If you are using Java 17 or 18, the JVM must be configured to use UTF-8 as the default charset by
adding `-Dfile.encoding=UTF-8` to `etc/jvm.config`. Starting with Java 19, the Java default
charset is UTF-8, so this configuration is not needed.

(requirements-python)=

### Python
Expand Down Expand Up @@ -136,6 +140,7 @@ The following provides a good starting point for creating `etc/jvm.config`:
-Djdk.nio.maxCachedBufferSize=2000000
-XX:+UnlockDiagnosticVMOptions
-XX:+UseAESCTRIntrinsics
-Dfile.encoding=UTF-8
# Disable Preventive GC for performance reasons (JDK-8293861)
-XX:-G1UsePreventiveGC
```
Expand Down