I have an issue running VSCode within Flatpak on Linux “JAVA_HOME”

I have a laptop running the Linux Mint distribution. I downloaded both VSCode and Android Studio using Flatpak. After installing Flutter and starting a mobile application project using Flutter, I encountered the following error message:
`

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.`

Please note that the issue is that Visual Studio Code cannot see the existing variable.

I tried to make sure that Java is installed and included in the environment variables.

The problem is that the program within the Flatpak environment cannot access external environment variables.

as far as I know, flatpak isolates your apps from your system with its dependencies it’s like a docker container

try installing them on the system itself using apt, pacman…

Leave a Comment