JDK – Platform Not Recognized – Running Eclipse or mvn

eclipsejava

I screwed it up! I upgraded to Java 8 yesterday and that trashed some projects I was working on so I attempted to downgrade back to Java 7 and the wheels came off.

I've removed the previous Java directories in both JavaVM.framework and JavaVirtualMachines.

I re-ran the jdk-7u71-macosx-x64 and it complains during validation. The extremely informative: The Installation encountered an error … blah blah.. go contact someone who cares. No details as to why it fails.

so freaking helpful

I can verify its presence though:

 ls -l /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/*
 total 8
 drwxrwxr-x  15 root  wheel   510 Mar 28 09:03 Home
 -rw-rw-r--   1 root  wheel  1577 Sep 26  2014 Info.plist
 drwxrwxr-x   3 root  wheel   102 Mar 28 09:03 MacOS

including:

java -version

 java version "1.7.0_71"
 Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
 Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Also have it linked back to /usr/bin/java and /Library

ls -l /Library/Java/Home/*
-rw-rw-r--  1 root  wheel      3339 Sep 26  2014 /Library/Java/Home/COPYRIGHT
-rw-rw-r--  1 root  wheel        40 Sep 26  2014 /Library/Java/Home/LICENSE
-rw-rw-r--  1 root  wheel       114 Sep 26  2014 /Library/Java/Home/README.html
-rw-rw-r--  1 root  wheel    110114 Sep 26  2014 /Library/Java/Home/THIRDPARTYLICENSEREADME-JAVAFX.txt
-rw-rw-r--  1 root  wheel    173559 Sep 26  2014 /Library/Java/Home/THIRDPARTYLICENSEREADME.txt
-rw-rw-r--  1 root  wheel       502 Sep 26  2014 /Library/Java/Home/release
-rw-rw-r--  1 root  wheel  20057582 Sep 26  2014 /Library/Java/Home/src.zip

/Library/Java/Home/bin:
total 7840
-rwxrwxr-x  1 root  wheel   99296 Sep 26  2014 appletviewer
-rwxrwxr-x  1 root  wheel   99296 Sep 26  2014 apt
-rwxrwxr-x  1 root  wheel   99296 Sep 26  2014 extcheck

...

When I try to run eclipse or mvn it complains Platform Not Recognized. Most especially around the FileSystem.

How do I get the underlying libraries back on here?

(My backups are up to date… Is there something I can restore that would help my situation or will I only make things worse?)


./eclipse  
org.osgi.framework.BundleException: Error initializing container. at
org.eclipse.osgi.container.SystemModule.init(SystemModule.java:93) at
org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:209) at
org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:201)at 
org.eclipse.osgi.launch.Equinox.init(Equinox.java:168)  at
org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:296) at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231 at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at
java.lang.reflect.Method.invoke(Method.java:606)    at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)    at
org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)   at
org.eclipse.equinox.launcher.Main.run(Main.java:1465) Caused by:
java.lang.AssertionError: Platform not recognized   at
sun.nio.fs.DefaultFileSystemProvider.create(DefaultFileSystemProvider.java:73) at
java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:108) at
java.nio.file.FileSystems$DefaultFileSystemHolder.access$000(FileSystems.java:89) at
java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:98 at
java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:96 at
java.security.AccessController.doPrivileged(Native Method)  at
java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(FileSystems.java:95) at
java.nio.file.FileSystems$DefaultFileSystemHolder.<clinit>(FileSystems.java:90) at
java.nio.file.FileSystems.getDefault(FileSystems.java:176)  at
sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:483)     at
sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:478)     at
java.security.AccessController.doPrivileged(Native Method)  at
sun.util.calendar.ZoneInfoFile.<clinit>(ZoneInfoFile.java:477)  at
sun.util.calendar.ZoneInfo.getTimeZone(ZoneInfo.java:663)   at
java.util.TimeZone.getTimeZone(TimeZone.java:566)   at
java.util.TimeZone.setDefaultZone(TimeZone.java:663)    at
java.util.TimeZone.getDefaultRef(TimeZone.java:630)     at
java.util.GregorianCalendar.<init>(GregorianCalendar.java:586)  at
org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.clockValueNow(UniversalUniqueIdentifier.java:90) at
org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.timestamp(UniversalUniqueIdentifier.java:253) at
org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.setTimeValues(UniversalUniqueIdentifier.java:228) at
org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.<init>(UniversalUniqueIdentifier.java:73) at
org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.initWorker(EquinoxBundle.java:137) at
org.eclipse.osgi.container.SystemModule.init(SystemModule.java:83)
... 12 more

Best Answer

I think you now need to re-install the "old" Apple Java, so it can link it self up again.

Download Java for OS X 2014-001, and install it - this will re-install /System/Library/Frameworks/JavaVM.framework, and just to be sure, install Java 7_75 or 7_76 (the newest update for Oracle Java) again.