firebase-tools no longer supports Java version before 11. Please upgrade to Java version 11 or above to continue using the emulators
Asked Answered
G

7

24

I have version 11.0.1 of firebase installed on my Windows 11 machine. When I run the firebase emulators, it crashes with this message:

$ firebase emulators:start

!! emulators: firebase-tools no longer supports Java version before 11. Please upgrade to Java version 11 or above to continue using the emulators. i emulators: Shutting down emulators.

Error: firebase-tools no longer supports Java version before 11. Please upgrade to Java version 11 or above to continue using the emulators.

I try to update my Java but it says I have the latest version:

enter image description here

I check what version I have and it says version 8... though I need 11? I'm confused:

enter image description here

I try checking the version in the CLI and I get even more confused:

$ java -version
java version "1.8.0_333"
Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)

My questions are:

  1. How can I get my firebase emulators to run again?
  2. What version of Java do I have? 11? 8? 1.8?
  3. How can I upgrade to the latest version of Java?
Ginzburg answered 30/5, 2022 at 18:3 Comment(1)
To add clarification around the "latest version" message, it is probably saying you have the latest version of Java 8, not that you have the latest major version. It is often undesirable to automatically update to the latest major version automatically.Primrosa
O
47

I just had the same error and just went through the all version 8 vs. version 11, etc. but now I get it.

firebase-tools is referring to the version of the JDK installed, not the version of Java runtime installed.

The latest JDK from Oracle can be downloaded from https://www.oracle.com/java/technologies/downloads/#jdk18-mac with the latest version being 18.

The Java runtime for Mac latest version is indeed 8, but again that's not what firebase tools is looking for

Obituary answered 5/8, 2022 at 1:24 Comment(2)
Also available via Homebrew formulae.brew.sh/cask/oracle-jdk#defaultEveliaevelin
Thank you! I consider this a minor bug/typo honestly, because they say "Java". That word does nót imply 'dev kit' and assuming everyone is up to speed with java's unclear versioning is not a good practice IMO.Trichomoniasis
J
6

For future visitors

If you're using older version of the firebase-tools(<11.), you will get some logs/warning like the following when you run the Firebase local emulator:

emulators: Support for Java version <= 10 will be dropped soon in firebase-tools@11. 
Please upgrade to Java version 11 or above to continue using the emulators.

But you have this in your log:

firebase-tools no longer supports Java version before 11. Please upgrade to Java version 11
or above to continue using the emulators

It means that you have firebase-tools>=11. and you need to install the java version 11. In my case I preferred to downgrade my firebase-tools.

Downgrade firebase-tools

Here you can find the npm page and learn about the package and the versions.

The latest version for 10, is v10.9.2.

First you need to remove the current installed version of firebase-tools:

npm uninstall -g firebase-tools  

Then you can install the version you want:

npm i -g [email protected] 

And there other way is to upgrade your java version to >=11 and use the latest version of firebase-tools.

Jumbo answered 19/6, 2022 at 18:23 Comment(2)
I just did this and get ⚠ ui: Fatal error occurred: Emulator UI has exited with code: 1. Not sure if it's related. So I can't run the emulator since I don't have Java 11 :(Celin
@MoteZart Maybe this issue is the reason?Jumbo
S
3

The command to deterine installed JDK is:

javac -version

(while java -version if for Java Runtime version)

I had the same issue on Windows and upgrading Java through Java updater or dowloading JDK from Oracle didn't help (propably it could). On the other hand Firebase installation doc refers to Open JDK: https://firebase.google.com/docs/emulator-suite/install_and_configure

So I uninstalled all "commercial" Java and downloaded: https://openjdk.org/install/

Open JDK needs only unpacking and setting JAVA_HOME and PATH system variables: JAVA_HOME and PATH https://docs.plm.automation.siemens.com/content/polarion/19.1/help/en_US/polarion_windows_installation/before_installation/install_openjdk_11.html

There is no installation and messing with host system files, etc.

Sabayon answered 1/12, 2022 at 20:56 Comment(1)
I've confirmed that my javac version is > 11, but I still get the error.Liber
M
1

The best way to tell what version you have is to open a terminal shell and type:

java -version

I think you have JDK 8. That is long past the end of its support life.

You want either JDK 11 or, better yet, 17. Those are the two LTS versions to choose from.

You can download JDK 11 or 17 from OpenJDK.

Munro answered 30/5, 2022 at 18:10 Comment(0)
H
0

On macOS you can download the latest version of the JDK by downloading the OpenJDK installer on AdoptOpenJDK.

Himyarite answered 29/6, 2022 at 14:45 Comment(0)
H
0

On Windows, make sure that your Environment Variables are correct for Java. I installed jdk-17 and changed the JAVA_HOME system variable to C:\Program Files\Java\jdk-17

Have a look at https://www.happycoders.eu/java/how-to-switch-multiple-java-versions-windows/ for more info.

This solved the firebase emulator problem.

Hubert answered 6/3, 2023 at 13:41 Comment(0)
N
0

What simply solved my issue; I went to Oracle official page, and installed the latest version of JDK. Previously, I had the install the openjdk using brew, but it didn't work.

Nicolais answered 13/2 at 11:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.