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.

I’ve downloaded the correct jdk (jdk1.6.0, 32bit (x86)), but the corona can’t find it. 

I’ve tried uninstalling and reinstalling…both…but nothing changed.

Is there anyway to tell corona where the jdk is?

It needs to be in your path.  Are you on Windows or a Mac?

I’m on windows.

This should get you going:  http://www.kingluddite.com/tools/how-do-i-add-java-to-my-windows-path

Make sure to put the path of your Java install in there, not the exact example they have as your JDK may be a different version in a different folder.

Rob

Changed the path, but corona keeps trying to load a jvm.dll file in a complete different path.

Did you put the new path at the beginning or end of the path?  It will start with the first directory in the list and search until it finds one.  You want to make sure the one you want is first.

Rob

I put it at the start just like it said in the link.