Flutter usually points at a specific java var in the environment not the javac command, i think its JAVA_HOME or something, so usually its locate and package within android studio.
You can download and install Flutter using only android-sdk (cli). I did it a lot because i hate Android Studio. It's easier than it looks.