fix(server): 직접 선택한 JDK 도 Java 25+ 검증 후 진행

자동 탐색은 Java 25 미만을 걸렀지만, 사용자가 직접 입력/폴더선택한 JDK 는
버전 검증 없이 다음 단계로 넘어가 run.bat 이 낡은 자바로 패치될 수 있었다.
그러면 서버가 여전히 UnsupportedClassVersionError 로 뜨지 않는다.

- jdk:verify IPC 추가(java -version 으로 메이저 버전 확인) + preload 노출.
- JDK 단계 "다음" 에서 선택 경로를 검증해 Java 25 미만이거나 버전을 못 읽으면
  진행을 막고 안내. 자동 설치/자동 탐색 경로도 이 게이트를 통과.
- 버전 0.4.4→0.4.5.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 00:45:06 +09:00
parent 48e0421135
commit a6118039a3
5 changed files with 42 additions and 5 deletions

View File

@@ -320,6 +320,15 @@ ipcMain.handle('jdk:detect', async () => {
return { found: false, path: '' }
})
// 사용자가 직접 입력/선택한 JDK 경로가 서버 실행에 충분한 버전인지 확인한다.
// ok=true → major >= 요구 버전(25).
// major=0 → 경로에서 java 를 못 찾거나 버전을 못 읽음(실행 실패 등).
ipcMain.handle('jdk:verify', async (_event, jdkPath: string): Promise<{ ok: boolean; major: number; required: number }> => {
const javaExe = jdkPath ? findJavaExeInHome(jdkPath) : ''
const major = javaExe ? getJavaMajor(javaExe) : 0
return { ok: major >= REQUIRED_JAVA_MAJOR, major, required: REQUIRED_JAVA_MAJOR }
})
// ── JDK 자동 설치(Temurin 25, 취소 가능) ──────────────────────────────
interface JdkInstallState {
controller: AbortController | null

View File

@@ -25,6 +25,8 @@ const api = {
// 3-2
detectJdk: (): Promise<{ found: boolean; path: string }> => ipcRenderer.invoke('jdk:detect'),
verifyJdk: (jdkPath: string): Promise<{ ok: boolean; major: number; required: number }> =>
ipcRenderer.invoke('jdk:verify', jdkPath),
installJdk: (): Promise<{ ok: boolean; path?: string; message?: string }> => ipcRenderer.invoke('jdk:install'),
cancelJdkInstall: (): Promise<{ ok: boolean }> => ipcRenderer.invoke('jdk:cancelInstall'),