This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 4d9347088d Fixes neo4j when used with jdk17 CTR
new e6e6e9beac Merge branch '3.7-dev'
4d9347088d is described below
commit 4d9347088d0ec0e5f5d87ab78358d687620ca4d5
Author: Stephen Mallette <[email protected]>
AuthorDate: Fri Jul 12 11:25:03 2024 -0400
Fixes neo4j when used with jdk17 CTR
---
CHANGELOG.asciidoc | 13 +++++++------
docs/src/reference/implementations-neo4j.asciidoc | 3 +++
gremlin-console/src/main/bin/gremlin.sh | 6 ++++++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 18820da91b..629d5f6109 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,12 +26,13 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
This release also includes changes from <<release-3-6-8, 3.6.8>>.
* Refactored mutation events registration by moving reusable code from
relevant steps to `EventUtil`
-* Open `NoOpBarrierStep` for extensibility (removed `final` keyword)
+* Open `NoOpBarrierStep` for extensibility (removed `final` keyword).
* Deprecated public constructor for `SeedStrategy` in favor of builder pattern
to be consistent with other strategies.
-* Allow specifying a customized Spark app name
-* CoinStep has a getter method for its probability field
-* Fixed so that TrimGlobalStep and TrimLocalStep have the same character
control handling as Ltrim and Rtrim
-* Fix a bug in MaxLocalStep, MinLocalStep, MeanLocalStep and SumLocalStep that
it throws NoSuchElementException when encounters an empty iterator as input.
+* Allow specifying a customized Spark app name.
+* Added getter method to `CoinStep` for its probability field.
+* Attempted to detect JDK version for Gremlin Console to avoid problems with
Java 17 if `neo4j-gremlin` is used.
+* Fixed so that `TrimGlobalStep` and `TrimLocalStep` have the same character
control handling as `Ltrim` and `Rtrim`
+* Fix a bug in `MaxLocalStep`, `MinLocalStep`, `MeanLocalStep` and
`SumLocalStep` that it throws `NoSuchElementException` when encounters an empty
iterator as input.
* Fix cases where Map keys of incomparable types could panic in `gremlin-go`.
[[release-3-7-2]]
@@ -102,7 +103,7 @@ This release also includes changes from <<release-3-6-6,
3.6.6>> and <<release-3
* Moved some TinkerGraph specific transaction tests from
`TransactionMultiThreadedTest` to `TinkerTransactionGraphTest`
* Fixed incorrect read operations in some cases for `TinkerTransactionGraph`.
* Updated JavaScript tests to check equality on only id and class when
comparing elements for consistency with other GLVs.
-* Improved performance for Element comparison by comparing hashCode() prior to
doing more expensive checks.
+* Improved performance for `Element` comparison by comparing hashCode() prior
to doing more expensive checks.
==== Bugs
diff --git a/docs/src/reference/implementations-neo4j.asciidoc
b/docs/src/reference/implementations-neo4j.asciidoc
index e15b008cee..cf61846336 100644
--- a/docs/src/reference/implementations-neo4j.asciidoc
+++ b/docs/src/reference/implementations-neo4j.asciidoc
@@ -23,6 +23,9 @@ remain compatible with upcoming releases of TinkerPop,
however long term support
be dropped from future versions of TinkerPop if compatibility cannot
reasonably be maintained. Alternative TinkerPop
enabled graph providers can be found on the
link:https://tinkerpop.apache.org/providers.html[TinkerPop site].
+WARNING: Neo4j-Gremlin can work with JDK17, but requires the use of the
`--add-opens` flag to be provided to the JVM
+as follows: `--add-opens=java.base/sun.nio.ch=ALL-UNNAMED`.
+
[source,xml]
----
<dependency>
diff --git a/gremlin-console/src/main/bin/gremlin.sh
b/gremlin-console/src/main/bin/gremlin.sh
index 9fbd8a0e05..36dcb4dd5c 100755
--- a/gremlin-console/src/main/bin/gremlin.sh
+++ b/gremlin-console/src/main/bin/gremlin.sh
@@ -108,6 +108,12 @@ if [ -n "$SCRIPT_DEBUG" ]; then
set -x
fi
+# Try to detect JDK version and add specific flag for JDK 17 to allow use of
neo4j-gremlin
+JAVA_VERSION=$($JAVA -version 2>&1 | awk -F '"' '/version/ {print $2}')
+if [[ "$JAVA_VERSION" == 17* ]]; then
+ JVM_OPTS+=( "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED" )
+fi
+
# Start the JVM, execute the application, and return its exit code
# shellcheck disable=SC2068
exec $JAVA ${JVM_OPTS[@]} org.apache.tinkerpop.gremlin.console.Console "$@"