I have jdk 1.6 installed on my machine and want to use that version for my Android Cocos2dx project so I can support older versions of android, but when I click on my project and go to File>Project Structure> and try to enter the path for my new JDK it says “Choose jdk 8 or newer” how are other people using jdk 6 ? please help anybody
Why do you need JDK 6? Only for older versions? What’s you preferred minSDK?
If you start at KitKat (API 19) you have a rate of 95% (source: https://developer.android.com/about/dashboards/). So you can use JDK 8, but compile with JDK 7 feature set.
PS: Or you switch to Kotlin, which is JDK6+ compatible.
For Android studio u need JDK 8, dont use latest one JDK 9 - it have a lot compability issues with soft, we supporting Android 4.1+ with JDK 8, there is no reason to support bellow Android-15,16 as even google play requires this as minimum version.
I wanted to support 4.1 (API 16) and above and in this book “Building Android games with cocos2d-x” it says “JDK 7 is required for building the applications for Android 5.0 and higher. You should download this version if you are targeting the latest Android versions. But, if you want your game to be compatible with Android versions that are older than 4.4, then you should pick JDK 6” so there is no way to get JDK 6 on my cocos2dx android project in Android Studio 3.1.2 ? or do I have just have to lower compile version for me to be able to select JDK 6 and not get the “Please choose JDK 8 or newer” warning ?
Also what do you mean by “you can use JDK 8, but compile with JDK 7” ? how is that possible to use 2 different jdk’s ? sorry im just kind of new to android dev so some of it is confusing
how are you supporting Android 4.1+ with JDK 8 ? what compile version are you using, because I thought you had to choose JDK 6 if you wanted to support older versions than 4.4 according to this book
“JDK 7 is required for building the applications for Android 5.0 and higher. You should download this version if you are targeting the latest Android versions. But, if you want your game to be compatible with Android versions that are older than 4.4, then you should pick JDK 6”

Not sure where from and what for this instructions, but if u put in gradle min sdk 15 everything still works.
It only means, that you can’t use Java 7 or 8 features (like try-with-resources or lambda) for Android versions below 5 or 7. As @energyy said, set the minSDK to whatever you want and don’t use the features, everything will work fine.
yeah, and if u using cocos2d-x there is no reason to use something on top for Android which will use Java 7/8 features.
Hmm. This isn’t right. I implemented a “sticker downloader” in the Android world for the GBoard.
It will be started at game launch and update the sticker pack, if the game received a (silent) push notification. I wouldn’t implement that in C++, because on iOS or desktop this isn’t possible. It’s a 100% Android only thing. And I was glad to use lambdas, that’s why I chose Kotlin for it.
@energyy You can argue, that this is just a gimmick, but it’s a nice one 
yeah, I mean such core functions like ads/push notifications u should do in Java, but some very very native Android modern stuff which appeared in latest Android version probably will not work on older devices so no need to try implement them only on Android or make it carefully with android version check - just my thoughts 
I use Kotlin, which will be compiled to Java 6. That means it can be used everywhere, even on the oldest Android versions out there. That’s why I don’t care about any JDK versions. 
It’s the same like the C++ version. You can compile with c++14 very fine with cmake/ndk-build. But you have to use the lowest Android API level for the c++ headers, if you use Android specific C++ code. You can’t build against API 19 (KitKat) and be sure it will run on Gingerbread without any problems.
You have to choose the right combination for your toolset for Android (as well as for iOS).
PS: I don’t want to confuse someone…
Hey @mars3142 , does cocos2d-x now compile with c++ 14 by default ? And does it use the c++ headers that you were referring to? How do we see the lowest android API level for the c++ headers ?

