JDK 6 needed for Android Builds?

You do *not* need to set the “PATH” environment variable to reference the JDK directory.  Nor do you need to create/set a “JAVA_HOME” environment variable.  Corona finds the installed JDK via the Windows registry.  So, running Sun/Oracle’s official JDK6 install program is enough, because it’ll store the installation path to the registry for Corona to find (as well as other 3rd party applications that use it).

Are you sure that you downloaded the official Oracle/Sun version of the JDK 6?

At the time of this posting, the Windows x86 version can be found here…

   http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html

If you did download this one, the other thing to consider is that the install program that you downloaded was corrupted.  Try re-downloading it, uninstall the old version, and install the downloaded version.  It should be this simple.  There is no need to modify any environment variables.

that was the one I used. I re-downloaded, re-installed…still getting the same error.

Can you give me more details about the error then?

Because I have no idea why this isn’t working for you.

When you click the “Build for Android” option in the menu, does the Build window get display?

Or do you see a warning message instead?

This is a very important detail.  If Corona displays the Build window, then that means Corona correctly found the JDK along with its libraries and tools.  If you can give me a screenshot of the error or the “exact” message, then I can help you better.

I click build for android and the error appears saying:  “Could not load E:\YR 3\eclipse\bin\client\jvm.dll, error 126”

Why corona is looking there I don’t know…I think I did at one point have a jvm.dll there.

After “ok” ing the error message the build window appears, however, clicking build doesn’t work because there is no key alias.

It then tells me my key store password is wrong and asks me to input one.

It sounds like your system’s “PATH” environment variable has a reference to the “E:\YR3\eclipse\bin\client” directory and it’s taking precedence over the JDK6 path Corona is trying to use to load the “jvm.dll”.  This is classic Windows DLL hell.  It’s causing Corona to load the wrong version of “jvm.dll” because it’s overriding the path that Corona wants to use.

One solution to this problem is to remove the “E:\YR3\eclipse\bin\client” path from your “PATH” environment variable.  This is what I recommend the most.  You’ll have to restart the Corona Simulator application in order for this environment variable change to take affect.  Just note that doing this might cause something to break in Eclipse.  (That said, in my experience, Eclipse does not set environment variables and uses relative paths to get to the JVM… unless something has changed recently.)

Another solution is to add a path to the JDK6 directory to the front of the “PATH” environment variable, but this will still likely cause something to break in Eclipse as well.

I tried adding the jdk6 to the “path” environment variable but it didn’t change anything.

I checked the “path” variable for a reference to the other directory…but it wasn’t there.

You’re probably looking at your user account’s environment variables.  Have a look at your “system” environment variables as well, because they are applied to all user accounts on Windows.

The only other thing I can recommend is to hunt down that “E:\YR 3\eclipse\bin\client” somewhere on your system, such as in the registry.  That said, I only recommend that you change the registry if you really know what you’re doing.  But somewhere on your system, that path is being set.  It’s up to you to find it.  This is definitely not a common issue because most people can set up their JDK environment quite easily.

I am having a similar problem. I’ve built for android with corona and used my keystore to sign it using the corona build window. I can successfully upload my app to the google play store and publish it. However, when I try to download it onto a phone it says there is an error with the package signing. I’ve manually installed the apk on the emulator and it installs just fine. I’ve also used this same keystore to publish an app that I built with the android sdk and it downloads fine from the google play store. Any ideas what is going on here? I have the 32 bit version of java 6 sdk installed as well as 64 bit version of java 7 installed. I’ve checked my PATH and made sure there is no reference to java in it.

spacewolf,

You’re running into a different issue.  Your APK is actually being signed correctly.  If it wasn’t, then you would never have been able to install your APK onto your device or upload it to Google Play.  Note that Google Play won’t even allow you to upload an APK that is signed with the debug.keystore or an expired keystore, so, it must be signed correctly.

If you’re running into a signature issue when downloading the APK to your device from Google Play, then that indicates the downloaded/installed APK is corrupted.  You see, there are 2 types of signatures in place here.  One signature is a form of identity.  The other signature is like a CRC used to determine if your app got corrupted or was tampered with… and that’s the signature issue that you’re likely running into.  In which case, the solution is to uninstall the app and re-download it.  If it still fails, then re-upload your APK to Google Play because it might have gotten corrupted when uploaded.

Hi Joshua,

Thank you for your reply. I had tried installing it on different devices and found the same error. However, I think I got it figured out now…

I noticed that when I opened a windows command prompt and typed in java -version. First thing wrong is that it recognized the java command! Second thing wrong is it came back with version 7 java! So I uninstalled all Java 7 versions and then reopened a command window and tried java -version again. This time it didn’t recognize the java command, which means it was successfully removed from my path.

I then went through the corona build for android and uploaded it to the google play store. Everything seems to be working fine now :slight_smile: So somehow java 7 was still being used to sign it. Pesky java 7!!!

I’m glad you solved it!  :slight_smile:

But that said, I’m quite sure the JDK 7 did *not* cause the signature issue.  Corona actually supports digitally signing an APK via the 32-bit and 64-bit JDK 7 if you’re using the last 2 release versions.  We know it works because you would have never been able to install your APK onto your device if it wasn’t signed correctly.  I think the APK you uploaded to Google Play just got corrupted.

Thought i would put this in for the Mac users (just in case a Mac user is searching re a Java problem) - as i read this and thought what version do i have??

Open Utilities folder -> Terminal -> then type

java -version

should produce a string then do a search of the string on the web - me i got “1.6.0_65”

T.

Was looking at system environment variables and I can’t find anything pointing to “E:\YR 3\eclipse\bin\client”.

I have tried it with the USB device that is the E:\ drive plugged in and not. nothing changes.

thank you for the help anyway.

This is troublesome topic, as I’m a new user who tried a test Android deployment, and faced with the dreaded inability of Corona to access the debug keystore.  Also, I’m one of those who has JDK8 x 64, on a Win 8.1, with no desire to remove it.  In the process of installing JDK6 as a second instance, I discovered another detail that might not be so obvious, especially since at least one post somewhere states that the JRE version doesn’t matter, pretty much diminishing its significance altogether.

To keep it short, I avoided installing the JRE along with JDK6, because all posts I read only pointed to the JDK dependency, and I already had a JRE installed.  In doing so, Corona still failed to open the keystore.  As a last resort, I uninstalled JDK6, but reinstalled it with its JRE… Success!  So, you do have to have the JRE, and not just JDK6.

To add to the confusion, the requirements page you’re taken to when searching for Corona dependencies states JDK6, but there’s a post above the states that JDK 7 should work.  So, which is the real requirement for Corona?  And, though there was a post that strongly suggested this was a Java issue, and not Corona’s implemention, JDK7’s new availability to Corona would seem to suggest otherwise.  Can Corona’s install process check to see if the necessary JDK is present and provide instructions to the developer, helping to avoid the time spent trying to solve these related issues? 

The 32-bit JDK6 requirement actually comes from Google because that is an Android requirement.  So therefore, that is Corona’s requirement too.  But that said, we’ve modified the Corona Simulator for “Windows” to support the 32-bit and 64-bit versions of both the JDK6 and 7 for your convenience, partly because Windows developers sometimes auto update their JDKs without thinking, but still, the official stance is we require JDK6 because that is Google’s requirement.

Also note that we’ve never tested Corona Simulator with JDK8.  I have no idea if it’ll work.  Nor do we plan on testing it in the near future, because again, Google’s Android does not support it either.  Remember that every major update to the JDK (ie: 6 to 7, 7 to 8) is a *breaking* change made by Oracle/Sun.  For example, the transition from JDK 6 to 7, Oracle changed the default encryption algorithm used to read/write keystores.  Corona is smart enough to use the correct algorithm for both, but we don’t know what breaking changes are in JDK8.  My suggestion is to stick to JDK6 or 7.  If you intend to do native Android development in the future, then you have no choice but to use JDK6.

This is troublesome topic, as I’m a new user who tried a test Android deployment, and faced with the dreaded inability of Corona to access the debug keystore.  Also, I’m one of those who has JDK8 x 64, on a Win 8.1, with no desire to remove it.  In the process of installing JDK6 as a second instance, I discovered another detail that might not be so obvious, especially since at least one post somewhere states that the JRE version doesn’t matter, pretty much diminishing its significance altogether.

To keep it short, I avoided installing the JRE along with JDK6, because all posts I read only pointed to the JDK dependency, and I already had a JRE installed.  In doing so, Corona still failed to open the keystore.  As a last resort, I uninstalled JDK6, but reinstalled it with its JRE… Success!  So, you do have to have the JRE, and not just JDK6.

To add to the confusion, the requirements page you’re taken to when searching for Corona dependencies states JDK6, but there’s a post above the states that JDK 7 should work.  So, which is the real requirement for Corona?  And, though there was a post that strongly suggested this was a Java issue, and not Corona’s implemention, JDK7’s new availability to Corona would seem to suggest otherwise.  Can Corona’s install process check to see if the necessary JDK is present and provide instructions to the developer, helping to avoid the time spent trying to solve these related issues? 

The 32-bit JDK6 requirement actually comes from Google because that is an Android requirement.  So therefore, that is Corona’s requirement too.  But that said, we’ve modified the Corona Simulator for “Windows” to support the 32-bit and 64-bit versions of both the JDK6 and 7 for your convenience, partly because Windows developers sometimes auto update their JDKs without thinking, but still, the official stance is we require JDK6 because that is Google’s requirement.

Also note that we’ve never tested Corona Simulator with JDK8.  I have no idea if it’ll work.  Nor do we plan on testing it in the near future, because again, Google’s Android does not support it either.  Remember that every major update to the JDK (ie: 6 to 7, 7 to 8) is a *breaking* change made by Oracle/Sun.  For example, the transition from JDK 6 to 7, Oracle changed the default encryption algorithm used to read/write keystores.  Corona is smart enough to use the correct algorithm for both, but we don’t know what breaking changes are in JDK8.  My suggestion is to stick to JDK6 or 7.  If you intend to do native Android development in the future, then you have no choice but to use JDK6.

Hi, I installed the Corona SDK and it is working fine. But now I wanted to install the Android Studio and SDK and it seems, that it requires Java SDK 7. I am a little bit confused now, so it is safe to install the SDK 7 also on the same windows machine?

Best regards,

Marco

Google’s newest Android SDK and their recently released Android Studio supports both JDK 6 and 7.  So, yes, it is now safe to install JDK 7.  But note that Google’s system requirements for Mac still requires the JRE 6.

   http://developer.android.com/sdk/index.html#Requirements

On Windows, you can easily install both JDK/JRE 6 and 7 on the same machine.  I’ve never tried to install separate versions of Java on Mac before.  So, you’re on your own there.

Hi, I installed the Corona SDK and it is working fine. But now I wanted to install the Android Studio and SDK and it seems, that it requires Java SDK 7. I am a little bit confused now, so it is safe to install the SDK 7 also on the same windows machine?

Best regards,

Marco