Skip to content

Commit 0db37fc

Browse files
harshyyy21joehangemini-code-assist[bot]
authored
Javaupdate (#9254)
* Add deprecation notice for Java < 21 * initialize deprecationNotices * return non empty deprecations * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: Joe Hanley <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 0cbd266 commit 0db37fc

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
- Deprecated Java versions below 21. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators.
12
- Fix Functions MCP log tool to normalize sort order and surface Cloud Logging error details (#9247)
23
- Fixed an issue where `firebase init` would require log in even when no project is selected. (#9251)

src/emulator/commandUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ export async function checkJavaMajorVersion(): Promise<number> {
587587
});
588588
}
589589

590-
export const MIN_SUPPORTED_JAVA_MAJOR_VERSION = 11;
590+
export const MIN_SUPPORTED_JAVA_MAJOR_VERSION = 21;
591591
export const JAVA_DEPRECATION_WARNING =
592-
"firebase-tools no longer supports Java versions before 11. " +
593-
"Please install a JDK at version 11 or above to get a compatible runtime.";
592+
"firebase-tools will drop support for Java version < 21 soon in firebase-tools@15. " +
593+
"Please install a JDK at version 21 or above to get a compatible runtime.";

src/emulator/controller.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,11 @@ export async function startAll(
295295
`No emulators to start, run ${clc.bold("firebase init emulators")} to get started.`,
296296
);
297297
}
298+
const deprecationNotices: string[] = [];
298299
if (targets.some(requiresJava)) {
299300
if ((await commandUtils.checkJavaMajorVersion()) < MIN_SUPPORTED_JAVA_MAJOR_VERSION) {
300301
utils.logLabeledError("emulators", JAVA_DEPRECATION_WARNING, "warn");
301-
throw new FirebaseError(JAVA_DEPRECATION_WARNING);
302+
deprecationNotices.push(JAVA_DEPRECATION_WARNING);
302303
}
303304
}
304305
if (options.logVerbosity) {
@@ -1039,7 +1040,7 @@ export async function startAll(
10391040
is_demo_project: String(isDemoProject),
10401041
});
10411042

1042-
return { deprecationNotices: [] };
1043+
return { deprecationNotices };
10431044
}
10441045

10451046
function getListenConfig(

0 commit comments

Comments
 (0)