SAP/hybris-commerce-eclipse-plugin

provide documentation for compatible eclipse IDE java version to SAP Commerce

mikolayek opened this issue · 1 comments

eclipse plugin uses core SAP Commerce jar files to execute build on importing project.
If Eclipse IDE JVM version is older than one which SAP Commerce has been build (case for 1811, which has been bumped to JVM11 instead good old JVM8), there is not possible to import project.
It is required to provide documentation for that, publish it.
Then update code in class com.hybris.hyeclipse.ytypesystem.Activator

// line 288
	public SystemConfig getSystemConfig() {
		if (systemConfig == null) {

			Hashtable<String, String> props = null;
			try {
				props = loadProperties(getPlatformHome());
				Field singletonField = SystemConfig.class.getDeclaredField("singleton");
				singletonField.setAccessible(true);
				singletonField.set(this, null);
				Field instanceField = PlatformConfig.class.getDeclaredField("instance");
				instanceField.setAccessible(true);
				instanceField.set(this, null);
			} catch (NoSuchFieldException | SecurityException | IOException | IllegalArgumentException
					| IllegalAccessException e) {
				logError("(NoSuchField|IO|Security|IllegalArgument|IllegalAccess)Exception", e);
			} catch (java.lang.UnsupportedClassVersionError err) {
				final Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID,
						"Incompatible JVM for IDE and SAP Commerce version", err);
				StatusManager.getManager().handle(status);

				printError("Incompatible JVM for IDE and SAP Commerce version",
						"eclipse IDE has to run on java version equal or greater than supported by SAP Commerce. More information how to change VM for IDE is available here: https://wiki.eclipse.org/Eclipse.ini",
						status);
			}

			systemConfig = SystemConfig.getInstanceByProps(props);
		}
		return systemConfig;
	}

Error occured while importing SAP Commerce 1811 having Eclipse IDE running JVM8
eclipse-ide-installation-details