JDK 6 needed for Android Builds?

Hi All,

I have some students that want to build for Android. I’ve personally not done this before so I’m working through this with them.

When we try to build for Android we get a warning that we need to have JDK 6 installed.

Is it enough to have JDK 6 on the computer or do we have to set the PATH variable as well?

This thread implies that as long as you have JDK 6, even if you have JDK 7 as well that Corona will find version 6 and be able to use it. Can anyone confirm if that’s correct?:
http://developer.coronalabs.com/forum/2011/08/02/installparsefailednocertificates#comment-114396

We’re imaging a new master computer for a batch of new computers we’re getting for our class and I’d like to get this all figured out so I can move forward with some programming lessons using Corona SDK. JDK 7 is already installed on the master image so I’m trying to figure out if we’re OK by just having JDK 6 on the machine or if we need to remove JDK 7.

Thanks for any advice regarding JDK 6. [import]uid: 105707 topic_id: 35468 reply_id: 335468[/import]

Corona still requires the 32-bit (x86) version of JDK 6 in order to do Android builds. This is an Android requirement set by Google.

On Windows, JDK 6 and JDK 7 can coexist on the same machine. Corona will fetch the path to the JDK 6 directory via the registry, which means it is *not* necessary to set the PATH environment variable (I recommend that you don’t). That said, there is a known issue where if the JDK 7 directory is set in your PATH environment variable, then the resulting APK will be digitally signed incorrectly (will use JDK 7’s sign tool which uses a default encryption Android does not support). In this case, you need to remove the JDK directory from your PATH environment variable if set.

You can download JDK 6 from here…
http://www.oracle.com/technetwork/java/javase/downloads/index.html
[import]uid: 32256 topic_id: 35468 reply_id: 140941[/import]

Hi Joshua,

To summarize, we can have JDK 6 and JDK 7 on the same machine. We just need to make sure the PATH variable is not set to JDK 7 when we build otherwise the build gets signed by JDK 7.

I don’t anticipate that we’ll be doing tons of builds. I’m thinking the best bet is to leave the JDK 7 PATH variable in place for any other applications that require it and then manually remove it if/when we build replacing the PATH once we’re done. A bit tedious but do-able. What do you think?

Thanks for your help :slight_smile: [import]uid: 105707 topic_id: 35468 reply_id: 141049[/import]

>> To summarize, we can have JDK 6 and JDK 7 on the same machine. We just need to make sure the PATH variable is not set to JDK 7 when we build otherwise the build gets signed by JDK 7.

Correct.

Also, the standard JDK installation programs do not modify the PATH environment variable. At least not in my experience. I suspect some developers are manually entering the JDK directory to the PATH or perhaps some 3rd party Java tools are adding it.

If you want, you can digitally sign the APK yourself with our “debug.keystore” at the command line as follows…

jarsigner -keystore "C:\Program Files\Corona Labs\Corona SDK\resources\debug.keystore" <pathtoyourapkfile> androiddebugkey<br>

Just make sure you are using in the JDK 6’s jarsigner tool by going to its directory at the command line. The password for Corona’s “debug.keystore” is “android”.

I hope this helps! [import]uid: 32256 topic_id: 35468 reply_id: 141076[/import]

Corona still requires the 32-bit (x86) version of JDK 6 in order to do Android builds. This is an Android requirement set by Google.

On Windows, JDK 6 and JDK 7 can coexist on the same machine. Corona will fetch the path to the JDK 6 directory via the registry, which means it is *not* necessary to set the PATH environment variable (I recommend that you don’t). That said, there is a known issue where if the JDK 7 directory is set in your PATH environment variable, then the resulting APK will be digitally signed incorrectly (will use JDK 7’s sign tool which uses a default encryption Android does not support). In this case, you need to remove the JDK directory from your PATH environment variable if set.

You can download JDK 6 from here…
http://www.oracle.com/technetwork/java/javase/downloads/index.html
[import]uid: 32256 topic_id: 35468 reply_id: 140941[/import]

Hi Joshua,

To summarize, we can have JDK 6 and JDK 7 on the same machine. We just need to make sure the PATH variable is not set to JDK 7 when we build otherwise the build gets signed by JDK 7.

I don’t anticipate that we’ll be doing tons of builds. I’m thinking the best bet is to leave the JDK 7 PATH variable in place for any other applications that require it and then manually remove it if/when we build replacing the PATH once we’re done. A bit tedious but do-able. What do you think?

Thanks for your help :slight_smile: [import]uid: 105707 topic_id: 35468 reply_id: 141049[/import]

>> To summarize, we can have JDK 6 and JDK 7 on the same machine. We just need to make sure the PATH variable is not set to JDK 7 when we build otherwise the build gets signed by JDK 7.

Correct.

Also, the standard JDK installation programs do not modify the PATH environment variable. At least not in my experience. I suspect some developers are manually entering the JDK directory to the PATH or perhaps some 3rd party Java tools are adding it.

If you want, you can digitally sign the APK yourself with our “debug.keystore” at the command line as follows…

jarsigner -keystore "C:\Program Files\Corona Labs\Corona SDK\resources\debug.keystore" <pathtoyourapkfile> androiddebugkey<br>

Just make sure you are using in the JDK 6’s jarsigner tool by going to its directory at the command line. The password for Corona’s “debug.keystore” is “android”.

I hope this helps! [import]uid: 32256 topic_id: 35468 reply_id: 141076[/import]

Thankyou for adding that x86.  I was lost on where to get 32 bit jdk.

Thankyou for adding that x86.  I was lost on where to get 32 bit jdk.

Hi all.

I have intstalled JDK 7 but not 6. Can I get Corona working with JDK 7? Or I need JDK 6.

Irual12,

No.  The last release version of Corona, build #1076, only supports the 32-bit (x86) version of JDK 6.  It will not work with any other version.  But Windows allows multiple version of the JDK to coexist on the same machine.  So, go ahead and install it.

You can download the JDK 6 from Oracle here…

   http://www.oracle.com/technetwork/java/javase/downloads/index.html

Hi all.

I have intstalled JDK 7 but not 6. Can I get Corona working with JDK 7? Or I need JDK 6.

Irual12,

No.  The last release version of Corona, build #1076, only supports the 32-bit (x86) version of JDK 6.  It will not work with any other version.  But Windows allows multiple version of the JDK to coexist on the same machine.  So, go ahead and install it.

You can download the JDK 6 from Oracle here…

   http://www.oracle.com/technetwork/java/javase/downloads/index.html

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.