Skip to content

Commit 3d3f541

Browse files
imjalpreettdcmeehan
authored andcommitted
docs: update README with Java 17 run flags for running Presto in IntelliJ
Add `-Djdk.attach.allowAttachSelf=true` to enable self-attach in Java 17, which is required for certain debugging and monitoring tools during local Presto development. Also include the necessary `--add-opens` flags to allow access to internal JDK APIs that Presto depends on.
1 parent dec4e72 commit 3d3f541

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ After opening the project in IntelliJ, double check that the Java SDK is properl
4949
Presto comes with sample configuration that should work out-of-the-box for development. Use the following options to create a run configuration:
5050

5151
* Main Class: `com.facebook.presto.server.PrestoServer`
52-
* VM Options: `-ea -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties`
52+
* VM Options: `-ea -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties -Djdk.attach.allowAttachSelf=true`
5353
* Working directory: `$MODULE_WORKING_DIR$` or `$MODULE_DIR$`(Depends your version of IntelliJ)
5454
* Use classpath of module: `presto-main`
5555

@@ -59,6 +59,32 @@ Additionally, the Hive plugin must be configured with location of your Hive meta
5959

6060
-Dhive.metastore.uri=thrift://localhost:9083
6161

62+
### Additional configuration for Java 17
63+
64+
When running with Java 17, additional `--add-opens` flags are required to allow reflective access used by certain catalogs based on which catalogs are configured.
65+
For the default set of catalogs loaded when starting the Presto server in IntelliJ without changes, add the following flags to the **VM Options**:
66+
67+
--add-opens=java.base/java.io=ALL-UNNAMED
68+
--add-opens=java.base/java.lang=ALL-UNNAMED
69+
--add-opens=java.base/java.lang.ref=ALL-UNNAMED
70+
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
71+
--add-opens=java.base/java.net=ALL-UNNAMED
72+
--add-opens=java.base/java.nio=ALL-UNNAMED
73+
--add-opens=java.base/java.security=ALL-UNNAMED
74+
--add-opens=java.base/javax.security.auth=ALL-UNNAMED
75+
--add-opens=java.base/javax.security.auth.login=ALL-UNNAMED
76+
--add-opens=java.base/java.text=ALL-UNNAMED
77+
--add-opens=java.base/java.util=ALL-UNNAMED
78+
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
79+
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
80+
--add-opens=java.base/java.util.regex=ALL-UNNAMED
81+
--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED
82+
--add-opens=java.base/sun.security.action=ALL-UNNAMED
83+
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED
84+
85+
These flags ensure that internal JDK modules are accessible at runtime for components used by Presto’s default configuration.
86+
It is not a comprehensive list. Additional flags may need to be added, depending on the catalogs configured on the server.
87+
6288
### Using SOCKS for Hive or HDFS
6389

6490
If your Hive metastore or HDFS cluster is not directly accessible to your local machine, you can use SSH port forwarding to access it. Setup a dynamic SOCKS proxy with SSH listening on local port 1080:

0 commit comments

Comments
 (0)