0

I have multiple Flutter Android app projects that have different compatibilities of Java.

Now, what should I do if I am developing more than one project simultaneously?

If the first one uses Java 17, and another uses Java 18,

What should I do in environment variables > system variables?

or

Are there any approaches to consider before building a Flutter Android app project?

1 Answer 1

1

For command line use JEnv: https://www.jenv.be/ It allows you to set the JDK to use on a per directory/project basis.

TIP: You can commit the .java-version file to source control, so only the first developer needs to set it and then everyone else on the project just inherits the correct setting.

--

For your IDE add the various JDK's to your IDE global settings and it will figure out which one to use when you set the Java (language) version in your project (at least IntelliJ does).

TIP: IntelliJ will read language versions in build files (pom.xml) and pick up the correct JDK

TL;DR - With good tooling, you don't need to manage it yourself.

3
  • Do I need to install multiple versions of Java to let the IDE or JEnv (if I set it right) do the other processes for me?
    – DevQt
    Commented Nov 21, 2024 at 5:20
  • You will need to install them, depending upon you platform you may have several choices: Unpack a zip/tar file, use a native installer, use a package manager for your platform. In most cases it doesn't matter how you install them, you just need to add the directory to JEnv and your IDE.
    – DavidT
    Commented Nov 21, 2024 at 5:35
  • Thank you so much for the info <3
    – DevQt
    Commented Nov 21, 2024 at 5:52

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.