# Tomcat with Java 17+

**URL:** <https://faq.inetsoftware.de/t/tomcat-with-java-17/281>\
**Category:** i-net Clear Reports\
**Tags:** servlet\
**Created:** [September 28, 2023, 9:50am UTC](https://faq.inetsoftware.de/t/tomcat-with-java-17/281 "2023-09-28T09:50:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GerryWeissbach](https://faq.inetsoftware.de/user_avatar/faq.inetsoftware.de/gerryweissbach/32/90_2.png) [@GerryWeissbach](https://faq.inetsoftware.de/u/GerryWeissbach)\
**Post date:** [September 28, 2023, 9:50am UTC](https://faq.inetsoftware.de/t/tomcat-with-java-17/281/1 "2023-09-28T09:50:12Z")

</div>

Deploying i-net Clear Reports **reporting.war** in Tomcat may result in errors in the log file:

```java
[Config,ERROR ,9/28 9:37:16,#00002] java.lang.reflect.InaccessibleObjectException: Unable to make field static java.util.Hashtable java.net.URL.handlers accessible: module java.base does not "opens java.net" to unnamed module @447582b6
...
[Config,ERROR ,9/28 9:37:16,#00002] Could not register the URL protocol: data
[Config,ERROR ,9/28 9:37:16,#00002] java.net.MalformedURLException: unknown protocol: data
...
[Config,ERROR ,8/6 11:04:05,#00001] Could not register the URL protocol: drive
[Config,ERROR ,8/6 11:04:05,#00001] java.net.MalformedURLException: unknown protocol: drive

```

The solution requires to add `java.base/java.net` to the allowed modules. You can do this in the following ways:

### Windows

You have to update the **catalina.bat** with the following _JDK\_JAVA\_OPTIONS_:

```bash
set "JDK_JAVA_OPTIONS=%JDK_JAVA_OPTIONS% --add-opens=java.base/java.net=ALL-UNNAMED"

# Tomcat 10+
set "JAVA_OPTS=%JAVA_OPTS% --add-opens=java.base/java.net=ALL-UNNAMED"

```

Now restart the server.

### Linux / macOS

You have to update the **catalina.sh** with the following _JDK\_JAVA\_OPTIONS_:

```bash
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.net=ALL-UNNAMED"

# Tomcat 10+
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.net=ALL-UNNAMED"

```

Now restart the server.

### Docker Container

In a Docker container, where the Tomcat is installed, it may suffice to set the environment variable, e.g. using:

```bash
export JDK_JAVA_OPTIONS="--add-opens=java.base/java.net=ALL-UNNAMED"

# Tomcat 10+
export JAVA_OPTS="--add-opens=java.base/java.net=ALL-UNNAMED"

```
