Tuesday, 11 October 2022

Visual Studio cannot compile an Android Java file

Visual Studio 2019, Windows 10.

I can successfully compile a Native (C++) Android project and have it running on the phone with Visual Studio.

Now, in order to add some Java I first created a minimal Hello World project in Visual Studio for Android/Java. However I get a note at the top: "Java Developer Kit installation not found (Status JDKRegKeyNotFound). Intellisense is not available" Also the code won't compile:

"EXEC : [javac] error : Source option 5 is no longer supported. Use 7 or later."

Installed: C:\Program Files\Java\jdk-17.0.4.1

JAVA_HOME set to C:\Program Files\Java\jdk-17.0.4.1

Path includes %JAVA_HOME%\bin

Java SE Development Kit set to C:\Program Files\Java\jdk-17.0.4.1 in Options -> Cross Platform -> C++ -> Android in Visual Studio

Android/Java

I've googled for Source option 5 is no longer supported. Use 7 or later. but found only solutions for Android Studio or Eclipse.

Any suggestions how to fix these errors?



from Visual Studio cannot compile an Android Java file

No comments:

Post a Comment