From 3c9fdd52bb1a00407bf2ea87a4729e6103962a67 Mon Sep 17 00:00:00 2001 From: "harshoza24@gmail.com" Date: Fri, 3 Oct 2025 15:19:36 -0500 Subject: [PATCH 1/3] Add deprecation notice for Java < 21 --- CHANGELOG.md | 1 + src/emulator/commandUtils.ts | 6 +++--- src/emulator/controller.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d89e2876c1..ef8dc124429 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- Marks Java 11 and below as deprecated. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators. - Fixed an issue with deploying indexes to Firestore Enterprise edition databases where explicit `__name__` fields could be incorrectly handled. - The `experimental:mcp` command has been renamed to `mcp`. The old name is now an alias. - `firebase_update_environment` MCP tool supports accepting Gemini in Firebase Terms of Service. diff --git a/src/emulator/commandUtils.ts b/src/emulator/commandUtils.ts index 0c59fe1628f..43cd9a72b05 100644 --- a/src/emulator/commandUtils.ts +++ b/src/emulator/commandUtils.ts @@ -587,7 +587,7 @@ export async function checkJavaMajorVersion(): Promise { }); } -export const MIN_SUPPORTED_JAVA_MAJOR_VERSION = 11; +export const MIN_SUPPORTED_JAVA_MAJOR_VERSION = 21; export const JAVA_DEPRECATION_WARNING = - "firebase-tools no longer supports Java versions before 11. " + - "Please install a JDK at version 11 or above to get a compatible runtime."; + "firebase-tools will drop support for Java version < 21 soon in firebase-tools@15. " + + "Please install a JDK at version 21 or above to get a compatible runtime."; diff --git a/src/emulator/controller.ts b/src/emulator/controller.ts index 71eb122d9e9..af08a1e3545 100755 --- a/src/emulator/controller.ts +++ b/src/emulator/controller.ts @@ -298,7 +298,7 @@ export async function startAll( if (targets.some(requiresJava)) { if ((await commandUtils.checkJavaMajorVersion()) < MIN_SUPPORTED_JAVA_MAJOR_VERSION) { utils.logLabeledError("emulators", JAVA_DEPRECATION_WARNING, "warn"); - throw new FirebaseError(JAVA_DEPRECATION_WARNING); + deprecationNotices.push(JAVA_DEPRECATION_WARNING); } } if (options.logVerbosity) { From 69f0c0550f3a6a7d53078dc1ebe8a1e96613d6a3 Mon Sep 17 00:00:00 2001 From: "harshoza24@gmail.com" Date: Fri, 3 Oct 2025 15:49:18 -0500 Subject: [PATCH 2/3] initialize deprecationNotices --- src/emulator/controller.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/emulator/controller.ts b/src/emulator/controller.ts index af08a1e3545..9530c4482c5 100755 --- a/src/emulator/controller.ts +++ b/src/emulator/controller.ts @@ -295,6 +295,7 @@ export async function startAll( `No emulators to start, run ${clc.bold("firebase init emulators")} to get started.`, ); } + const deprecationNotices: string[] = []; if (targets.some(requiresJava)) { if ((await commandUtils.checkJavaMajorVersion()) < MIN_SUPPORTED_JAVA_MAJOR_VERSION) { utils.logLabeledError("emulators", JAVA_DEPRECATION_WARNING, "warn"); From c757cc5153fc0b8727b87dd1568bf02e946934ab Mon Sep 17 00:00:00 2001 From: "harshoza24@gmail.com" Date: Fri, 3 Oct 2025 15:59:45 -0500 Subject: [PATCH 3/3] return non empty deprecations --- src/emulator/controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emulator/controller.ts b/src/emulator/controller.ts index 9530c4482c5..88004d71783 100755 --- a/src/emulator/controller.ts +++ b/src/emulator/controller.ts @@ -1040,7 +1040,7 @@ export async function startAll( is_demo_project: String(isDemoProject), }); - return { deprecationNotices: [] }; + return { deprecationNotices }; } function getListenConfig(