15 May 2013
Wednesday FAQs: Java and Windows Simulators
It’s Wednesday and time for another frequently asked questions (FAQs) session. Here are some FAQs about Java and the Windows Simulator.
1. Java 7 is the most recent version of Java, why does Corona SDK require Java 6?
Developing for Android requires Java 6, not Java 7 (according to the Android site). Corona SDK uses the Java tools for signing the APK, so we have the same requirements as if you were doing native Android development.
When you run Corona SDK and try to do a build, it checks to see if Java 6 is installed. If it doesn’t find Java 6, you will be prompted to install Java 6.
Note: Starting with Build 1103, we found a way to make Corona SDK run with Java 7, so now both the Mac and Windows Simulators can run with either Java 6 or Java 7 installed.
2. I keep getting a message on my Windows machine saying Java wants to update my Java (6) to Java 7. Should I upgrade?
If you are running the public build (971 or 1076), we don’t recommend running the Java updater because it may remove the JRE 6 binary files, causing Corona SDK build errors.
3. I can’t build for Android — the “Key Alias” field is empty
This generally means the Java 6 install is damaged. You will also get “keystore password not valid” error if you browse and select the debug keystore shipped with Corona SDK.
This can happen if you try to install Java 7 over Java 6 and the Java updater removes the JRE 6 (Java Runtime) binary files. We have seen this happen when you run Java (7) Updater 45. See question 5 for how to restore JRE 6.
4. I can’t build for Android — I get a “Could not load …/jvm.dll, error 126” message.
We added support for Java 7 in Build 1093 but it only worked correctly if you installed Java JDK7 from Oracle’s website. We found if you installed Java 7 using the Updater 45, it would remove a key DLL file, causing the above error message when trying to do a build in the Windows simulator. The solution is to use Build 1103, which now properly locates the DLL file. (This turned out to be a known Java Updater bug.)
5. I’ve installed Java 7 so how do I get Corona SDK Build 1076 working again?
Installing the Java 7 Updater removes the JRE 6 binary files but leaves the JRE 6 key in the Windows Registry making Corona SDK think Java 6 is installed. The solution is to re-install Java 6 JRE files. You can download JRE 6 here. Make sure you pick the 32-bit version for Windows (Windows X86).
Once you’ve run the Java 7 Updater and re-installed the JRE 6 files, you can build with both the public releases and the latest Corona SDK Daily Builds (starting with Build 1103).
That’s it for today’s questions. I hope you enjoyed them and even learned a few things!
Warren Fuller
Posted at 20:13h, 15 MayGreat post but the link in question #5 is to the Java JRE 6. Corona SDK needs the Java JDK 6 to build android apks:
http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.html
Tom Newman
Posted at 12:15h, 16 MayWarren, yes Corona needs JDK 6 to build Android apks but the link I provided is to reload the JRE 6 files removed by the Java 7 Updater. The Updater kept the JDK 6 files but removed the JRE 6 binary files, which causes the Corona build error.
Zen G
Posted at 13:21h, 16 MayThanks for this headsup. Sometimes it’s not wisest to upgrade… all the packages have to talk to each other…
I’m about to install Corona and Eclipse LDT now, might write about how it goes on my Free Thought Games wordpress blog… wish me luck 🙂