By: Derek Berube, Wildstar Technologies, LLC.Last Update: August 21, 2014
Back on Tuesday, the 18th of March 2014, Oracle announced the general availability of version 8.0 of the Java Development Kit. A few days later, I purchased the Manning Early Access Program (MEAP) edition of "Java 8 In Action", so I opened an instance of Safari, downloaded, and installed Java 8 on my Macbook Pro. A few months later, the Eclipse foundation announced the availability of the Luna release train for the Eclipse platform. As a technology enthusiast, I felt compelled to migrate my development environment the newest edition of Eclipse.
One of my favorite hosted web application runtime environments is the Google App Engine platform. App Engine provides a Java 7 JVM in a sandboxed environment and attempting to visit a site that has been compiled using the Java 8 compiler would result in a browser window displaying the following information.
This error was displayed even though the Java Compiler page for the project was configured to be compatible with Java 1.7.
If you examine the log file for your Google App Engine application, you will see a java.lang.UnsupportedClassVersionError error message similar to the one shown below:
NOTE: If you are like me and would like to see Google update the App Engine platform to be compatible with the Java 8 platform, please "star" issue 9537 in the App Engine public issue tracker.
The Eclipse platform provides a configuration file, the eclipse.ini , which is used to configure configure the bootstrap environment and underlying Java Virtual Machine. Instructing the Eclipse launcher to use the Java 7 JRE versus the default Java 8 JRE requires the use of the -vm parameter which is followed by the path to the java executable. On my machine, the eclipse.ini file is located in the /Applications/Eclipse/Eclipse.app/Contents/MacOS folder. The following are the contents of that environment BEFORE I made any changes.
The Oracle Java 7 SDK installs to the /Library/Java/JavaVirtualMachines/jdk1.7.0.jdk folder.
The following is a complete copy of my eclipse.ini file AFTER making the change. I've highlighted the new line in a boldface blue font.
After restarting Eclipse, you can confirm the above parameter has worked by displaying the "About Eclipse" page for the application and then left-clicking on the "Installation Details" button. Navigate to the "Configuration" panel and then locate the -vm parameter as depicted in the screen shot below.
Information from the following sources were used in the composition of this article.