|
| 1 | +--- |
| 2 | +title: Why am I getting a "Java class not found" error when starting deephaven-server? |
| 3 | +--- |
| 4 | + |
| 5 | +<em>I'm getting a cryptic `ValueError: Java class 'io.deephaven.python.server.EmbeddedServer' not found` error when trying to start the Deephaven server using the `deephaven-server` wheel. What's causing this?</em> |
| 6 | + |
| 7 | +<p></p> |
| 8 | + |
| 9 | +## The problem |
| 10 | + |
| 11 | +You see an error like this when running `deephaven server`: |
| 12 | + |
| 13 | +```text |
| 14 | +ValueError: Java class 'io.deephaven.python.server.EmbeddedServer' not found |
| 15 | +``` |
| 16 | + |
| 17 | +This cryptic error message typically indicates that you're using an incompatible Java version. |
| 18 | + |
| 19 | +## The solution |
| 20 | + |
| 21 | +**You must use Java 17 or later** when running `deephaven-server` version 0.36.0 and above. |
| 22 | + |
| 23 | +The Deephaven server wheel requires Java 17+ because: |
| 24 | + |
| 25 | +- Jetty 12 (used by Deephaven) requires Java 17 or later. |
| 26 | +- Jetty 11 reached end-of-life, prompting the upgrade. |
| 27 | + |
| 28 | +### How to Fix |
| 29 | + |
| 30 | +1. **Check your Java version:** |
| 31 | + ```bash |
| 32 | + java -version |
| 33 | + ``` |
| 34 | + |
| 35 | +2. **Install Java 17 or later** if needed: |
| 36 | + |
| 37 | + On Ubuntu/Debian: |
| 38 | + ```bash |
| 39 | + apt-get install openjdk-17-jdk |
| 40 | + ``` |
| 41 | + |
| 42 | + On macOS: |
| 43 | + ```bash |
| 44 | + brew install openjdk@17 |
| 45 | + ``` |
| 46 | + |
| 47 | +3. **Ensure Java 17 is being used** by your environment before starting the server: |
| 48 | + |
| 49 | + Verify the active Java version: |
| 50 | + ```bash |
| 51 | + java -version |
| 52 | + ``` |
| 53 | + |
| 54 | + If you have multiple Java versions installed, set `JAVA_HOME` to point to Java 17: |
| 55 | + |
| 56 | + On Linux/macOS: |
| 57 | + ```bash |
| 58 | + export JAVA_HOME=/path/to/java17 |
| 59 | + export PATH=$JAVA_HOME/bin:$PATH |
| 60 | + ``` |
| 61 | + |
| 62 | + On macOS with Homebrew: |
| 63 | + ```bash |
| 64 | + export JAVA_HOME=/usr/local/opt/openjdk@17 |
| 65 | + export PATH=$JAVA_HOME/bin:$PATH |
| 66 | + ``` |
| 67 | + |
| 68 | + On Windows (Command Prompt): |
| 69 | + ```cmd |
| 70 | + set JAVA_HOME=C:\Path\To\Java17 |
| 71 | + set PATH=%JAVA_HOME%\bin;%PATH% |
| 72 | + ``` |
| 73 | + |
| 74 | + On Windows (PowerShell): |
| 75 | + ```powershell |
| 76 | + $env:JAVA_HOME = "C:\Path\To\Java17" |
| 77 | + $env:PATH = "$env:JAVA_HOME\bin;$env:PATH" |
| 78 | + ``` |
| 79 | + |
| 80 | + To make these changes permanent, add them to your shell configuration file (e.g., `~/.bashrc`, `~/.zshrc`, or `~/.bash_profile`). |
| 81 | + |
| 82 | +### Example Dockerfile |
| 83 | + |
| 84 | +If you're using Docker, make sure to install the correct Java version: |
| 85 | + |
| 86 | +```dockerfile |
| 87 | +FROM ubuntu:24.04 |
| 88 | + |
| 89 | +RUN apt-get update && \ |
| 90 | + apt-get install -y software-properties-common && \ |
| 91 | + add-apt-repository ppa:deadsnakes/ppa && \ |
| 92 | + apt-get update |
| 93 | + |
| 94 | +RUN apt-get install -y \ |
| 95 | + python3.12 \ |
| 96 | + python3.12-venv \ |
| 97 | + python3.12-dev \ |
| 98 | + g++ \ |
| 99 | + openjdk-17-jdk # Use Java 17, not Java 11 |
| 100 | + |
| 101 | +# Create and activate virtual environment |
| 102 | +RUN python3.12 -m venv /venv |
| 103 | +RUN /venv/bin/pip install deephaven-server |
| 104 | + |
| 105 | +# Start server |
| 106 | +CMD ["/venv/bin/deephaven", "server"] |
| 107 | +``` |
| 108 | + |
| 109 | +## Additional Notes |
| 110 | + |
| 111 | +- The `deephaven-core` wheel (for client-side use) does not require Java to be installed. |
| 112 | +- The `deephaven-server` wheel requires Java 17+ to be available in your environment. |
| 113 | +- When creating a `Server` instance in Python (e.g., `from deephaven_server.server import Server`), you must have Java 17+ installed and available. |
| 114 | + |
| 115 | +> [!NOTE] |
| 116 | +> These FAQ pages contain answers to questions about Deephaven Community Core that our users have asked in our [Community Slack](/slack). If you have a question that is not in our documentation, [join our Community](/slack) and we'll be happy to help! |
0 commit comments