Skip to content

Commit 121e73c

Browse files
committed
feat: use jdk4py as default
1 parent 5a5a793 commit 121e73c

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

openapi_generator_cli/__init__.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import shutil
88
import subprocess
99
import sys
10+
from jdk4py import JAVA
1011
from typing import TYPE_CHECKING
1112

1213
if TYPE_CHECKING:
@@ -26,18 +27,7 @@ def run(args: list[str] | None = None) -> subprocess.CompletedProcess[bytes]:
2627
subprocess.CompletedProcess[bytes]: The result of running the OpenAPI Generator CLI.
2728
2829
"""
29-
java_path: Path | str | None
30-
try:
31-
from jdk4py import JAVA
32-
33-
java_path = JAVA
34-
except ImportError:
35-
java_path = shutil.which("java")
36-
if not java_path:
37-
msg = "java runtime is not found in PATH"
38-
raise RuntimeError(msg)
39-
40-
arguments = [java_path]
30+
arguments = [JAVA]
4131

4232
java_opts = os.getenv("JAVA_OPTS")
4333
if java_opts:

0 commit comments

Comments
 (0)