Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Proposal broke my Eclipse setup on Mavericks, and I can't seem to go back(String-based case error in a tutorial told me I needed 1.7, but this broke many other things)
icon4.gif  Proposal broke my Eclipse setup on Mavericks, and I can't seem to go back [message #1697936] Tue, 09 June 2015 16:32 Go to next message
Bella Strange is currently offline Bella StrangeFriend
Messages: 2
Registered: June 2015
Junior Member
Hello there everyone, brand new here to Java and Eclipse, although I've tinkered with C, Perl, etc. in the past. I had Eclipse all set up and working on my Mac (Mavericks/10.9), and was working my way through the Kilobolt tutorial, Day 7 More Flow Control (sorry, but I'm so new I can't post the link. Hopefully Google finds it; if not, let me know and I'll paste the text if I have to).

When Eclipse didn't like my string cases (Mario, Luigi, etc.). I did read the author's note where he says the strings don't work on 1.6, but for some reason I thought I was using 1.7 (I have installed Eclipse on another Mac as well, and I guess I got it mixed up) so went ahead with the string cases. I got an error upon running this class, and the marker proposed something along the lines of "Change to 1.7" (can't remember what it exactly said, and if there is a log of what happened, I have no idea how to find it), and oh how I wish now that I had not done so and just changed them to integers! When I did this, all of a sudden a whole bunch of other stuff did not work, such as System.out.println, and there was no "Undo" button, hah.

I'm not really sure what I've done since then, but hunting around on StackOverflow led me to add a 1.6 JRE library to the build environment for this package, and change compiler compliance to 1.6 (it did say 1.7 before I did this). Java -version in a text window says I have 1.6:

java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

But in the Java Control Panel (globally for the Mac), it says 1.8.0_45. The System.out.println statements are no longer causing an error, but I still get this in the Console:

Exception in thread "main" java.lang.UnsupportedClassVersionError: tutorial/CharacterSelect : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Sorry to be so all over the place, but I really am a newcomer to this and just want to get back to the tutorial so I can learn more and not generate n00b posts like this any longer. Thanks for any direction you can give me!
Re: Proposal broke my Eclipse setup on Mavericks, and I can't seem to go back [message #1697947 is a reply to message #1697936] Tue, 09 June 2015 17:53 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Making changes in the Java Control Panel wouldn't update your Eclipse preferences and project settings, both of which may contain pointers to an older installation of Java or no longer correct compiler settings. Double-check them and Clean and rebuild the project.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Proposal broke my Eclipse setup on Mavericks, and I can't seem to go back [message #1698163 is a reply to message #1697947] Thu, 11 June 2015 18:31 Go to previous message
Bella Strange is currently offline Bella StrangeFriend
Messages: 2
Registered: June 2015
Junior Member
Well, I had no idea what a correct compiler setting would be, or whether my installation of Java was older or not, so I had to keep looking for more detailed info unsuccessfully. Finally I ended up creating a whole new workspace (since I didn't know where the last one had gone wrong), and started getting Eclipse Build Errors about Java lang objects. That led me to a "dev-answers (dot) blogspot (dot) de" post (Eclipse forums still is not letting me post links) entitled "Eclipse build errors - java.lang.object cannot be resolved".

Didn't work the first time I tried it, as some Java 7 environment was referenced and when I deleted it the only workspace default available in File->Properties->Java Build Path, Libraries tab (Add Library->JRE System Library) was 1.6.0_65-b14-462, which gave me the Unsupported major.minor version 0.51.

Finally I tried again, and selected "Execution Environment" instead of the workspace default, which let me select JavaSE-1.7 and this gave me a different version of 1.6.0 (something about CDC-1.0/Foundation-1.0, whatever that is). Did "Clean Up" and then run (rebuild?) the class and it worked!
Previous Topic:Why does Eclipse search for metadata pertaing to non-existing project?
Next Topic:Isuses during migration from 3.8 to 4.4.2 Luna
Goto Forum:
  


Current Time: Fri Apr 26 21:00:41 GMT 2024

Powered by FUDForum. Page generated in 0.08403 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top