Eck, Java 1.7 ruins everything!

Anything libgdx related goes here!

Eck, Java 1.7 ruins everything!

Postby doomtoo » Wed Oct 19, 2011 3:07 pm

Was finally working on a tutorial for my website on setting up a demo in LibGDX, desktop and android versions.

Downloaded the new versions of everything, and installed with defaults. Desktop version worked, android version wouldn't find the game class, although only after compiling onto the device.

The android version would work on my old project.... Changed my old project into a barebones- everything exactly the same, still wouldn't work. The only difference at the end was just the Java version, changed it, and everything started working fine.

Summary:
LibGDX Desktop, Java 1.7=works
LibGDX Desktop, Java 1.7+Android=Does not work
LibGDX Desktop Java 1.6+Android=works

So using Java 1.7 doesn't even allow hello world to run correctly on android.

Just in case anyone else spends half a day widdling down there old projects to find what is wrong
Check out my website, and let me know what kind of tutorials you want!
http://www.chrismweb.com
doomtoo
 
Posts: 143
Joined: Mon Jun 13, 2011 6:03 am
Location: Arizona

Re: Eck, Java 1.7 ruins everything!

Postby esgeroth » Wed Oct 19, 2011 3:56 pm

I just tried java 1.7 in my project and its working fine. Android project runs fine. Sounds more like your build path isn't set up correctly.
esgeroth
 
Posts: 15
Joined: Sat Jun 18, 2011 7:20 pm

Re: Eck, Java 1.7 ruins everything!

Postby doomtoo » Wed Oct 19, 2011 6:10 pm

I don't know- that is the only thing I change, and it goes from working to not working.

I go through the process here:
http://chrismweb.com/2011/10/18/how-to-start-creating-android-games-using-the-libgdx-game-development-framework/#more-784

I added the Java project, added the libgdx .jar files, just like in the video tutorial, and the tutorial on the google code site- but it only works using Java 1.6....

I had uninstalled everything, to start from scratch, so maybe it was an issue of having the older SDK installed and the newest?

It's literally like a switch though - change java project to 1.6, android version runs. Change to 1.7, it can't find the Game class when loading on android, and crashes.
Check out my website, and let me know what kind of tutorials you want!
http://www.chrismweb.com
doomtoo
 
Posts: 143
Joined: Mon Jun 13, 2011 6:03 am
Location: Arizona

Re: Eck, Java 1.7 ruins everything!

Postby esgeroth » Thu Oct 20, 2011 3:41 am

What is the exact error that you get?
Even if there was a problem with that version of java I don't see how it would cause your project to fail to find a non java class.
Also, try cleaning your project.
esgeroth
 
Posts: 15
Joined: Sat Jun 18, 2011 7:20 pm

Re: Eck, Java 1.7 ruins everything!

Postby syl » Thu Oct 20, 2011 3:49 pm

hey,

that's totally normal


[2011-10-20 17:45:48 - SpeedX-Android] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
[2011-10-20 17:45:48 - SpeedX-Android] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.


You need to do right click on your android project, then Android Tools > Fix Project Properties

Then, you will also need to go into Properties (of the android project), Java Compiler, and set 1.6 instead of 1.5 at Compiler compliance level
syl
 
Posts: 212
Joined: Mon Nov 01, 2010 10:25 pm
Location: Bordeaux, France

Re: Eck, Java 1.7 ruins everything!

Postby doomtoo » Fri Oct 21, 2011 4:45 am

Nah, I did the project->Fix project, but that didn't help.

I get the error that it can't find the Game class - which is in my Java class, and compiles fine.
Check out my website, and let me know what kind of tutorials you want!
http://www.chrismweb.com
doomtoo
 
Posts: 143
Joined: Mon Jun 13, 2011 6:03 am
Location: Arizona

Re: Eck, Java 1.7 ruins everything!

Postby doomtoo » Fri Oct 21, 2011 6:13 pm

here is the exact error:

Code: Select all
10-21 11:09:05.611: E/AndroidRuntime(4404): java.lang.NoClassDefFoundError: com.ackmi.dressup.Game
10-21 11:10:53.173: W/dalvikvm(5284): VFY: unable to resolve new-instance 182 (Lcom/ackmi/dressup/Game;) in Lcom/ackmi/dressup/DressUpActivity;


And all that causes that is running the application with Java 1.7. If I change it back to 1.6, it works fine. Had my girlfriend try it out on her computer without telling her what would happen, and she gets the exact same error.

(looking at the project settings for android, it's auto set to Java 1.5 - maybe Java allows backwards compatibility with at least 1 version- and aren't supporting fully back to 1.5?)
Check out my website, and let me know what kind of tutorials you want!
http://www.chrismweb.com
doomtoo
 
Posts: 143
Joined: Mon Jun 13, 2011 6:03 am
Location: Arizona

Re: Eck, Java 1.7 ruins everything!

Postby syl » Fri Oct 21, 2011 6:35 pm

ok, given your summary, and given the fact that android does not support java 7, that was my guess, now, i think you should try the big clean, by migrate to a new workspace and setting up completely your projects

also, java 1.5 = 5, 1.6 = 6, 1.7 = 7 http://en.wikipedia.org/wiki/Java_version_history

You may find some help here http://stackoverflow.com/questions/7153 ... th-android
syl
 
Posts: 212
Joined: Mon Nov 01, 2010 10:25 pm
Location: Bordeaux, France

Re: Eck, Java 1.7 ruins everything!

Postby doomtoo » Sun Oct 23, 2011 2:44 am

Yeah thanks- it'll just be something to remember when setting up new projects that wasn't there a month or so ago, with the newest tools downloaded.
Check out my website, and let me know what kind of tutorials you want!
http://www.chrismweb.com
doomtoo
 
Posts: 143
Joined: Mon Jun 13, 2011 6:03 am
Location: Arizona


Return to Libgdx

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 10 guests