From fe7f2b726472b05ad3293b86fc0d1eacd67a0cc4 Mon Sep 17 00:00:00 2001 From: harazdovskiy Date: Tue, 26 Jul 2022 12:02:48 +0300 Subject: [PATCH] doc: Added troubleshooting section with the guide of fixing incompatible java version --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index ade5482..297ceec 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,52 @@ module.exports = () => { it(); ``` +## Troubleshooting + +
+ Issue running tests locally - Exception in thread "main" + +```shell +Exception in thread "main' +java.lang.UnsupportedOperationException The Security Manager is deprecated and will be removed in a future release +at java.base/java.lang.System.setSecurityManager(System. java: 416) +at ora.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.iava:71 +``` +The main reason why this issue appears is that you have an incompatible java version installed to run elastic locally. + +### What to do? + +1. List current java versions +```shell +$ /usr/libexec/java_home -V +``` + +2. If you see version 1.8.xxx + Add this command to your bashrc, zshrc, etc +```shell +$ /usr/libexec/java_home -v 1.8 +``` + +3. If you see no versions or do not have a compatible version installed - Install version 1.8xxx +https://www.java.com/en/download/ + +4. Reload the console and check the java version with +```shell +$ java -version +``` +Output for proper work +```shell +$ java -version +java version "1.8.0_333" +Java(TM) SE Runtime Environment (build 1.8.0_333-b02) +Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode) +``` + +5. Go to step 2 and set version 1.8xx as a default for the shell + + +
+ ## See Also - [jest-dynamodb](https://github.com/shelfio/jest-dynamodb)