### Eclipse Workspace Patch 1.0 #P org.jboss.tools.vpe.browsersim Index: src/org/jboss/tools/vpe/browsersim/ui/messages.properties =================================================================== --- src/org/jboss/tools/vpe/browsersim/ui/messages.properties (revision 43326) +++ src/org/jboss/tools/vpe/browsersim/ui/messages.properties (working copy) @@ -35,6 +35,9 @@ ExceptionNotifier_BROWSERSIM_IS_FAILED_TO_START_ON_LINUX=BrowserSim is failed to start with the following error\:\n"{0}"\n\ Please note that WebKitGTK 1.2.0 or newer must be installed and available in the library load path.\n\ If not, use your package manager to install libwebkitgtk.\nAlso see BrowserSim FAQ. +ExceptionNotifier_JRE_1_7_IS_NOT_SUPPORTED_ON_WINDOWS=JRE 7 is not supported by BrowserSim on Windows.\n\ +Please either run Eclipse with JDK 7, or with JRE/JDK 6.\n\ +Also see BrowserSim FAQ. ManageDevicesDialog_ADD=Add ManageDevicesDialog_ALWAYS_TRUNCATE=Always truncate ManageDevicesDialog_CANCEL=Cancel Index: src/org/jboss/tools/vpe/browsersim/ui/ExceptionNotifier.java =================================================================== --- src/org/jboss/tools/vpe/browsersim/ui/ExceptionNotifier.java (revision 43326) +++ src/org/jboss/tools/vpe/browsersim/ui/ExceptionNotifier.java (working copy) @@ -35,6 +35,12 @@ && error.getMessage() != null // Apple Application Support is not installed && error.getMessage().contains("Safari must be installed to use a SWT.WEBKIT-style Browser")) { //$NON-NLS-1$ message = Messages.ExceptionNotifier_APPLE_APPLICATION_SUPPORT_IS_NOT_FOUND; + } else if (PlatformUtil.OS_WIN32.equals(os) && PlatformUtil.ARCH_X86.equals(arch) // Eclipse 32-bit on Windows and + && error.getMessage() != null // Apple Application Support is not installed and + && error.getMessage().contains("No more handles [Failed to load the swt-webkit library]") // Safari libs cannot be loaded and //$NON-NLS-1$ + && "1.7".equals(System.getProperty("java.specification.version"))) { //Java version is 1.7 //$NON-NLS-1$ //$NON-NLS-2$ + // see JBIDE-12467: Unable to Run Browsersim in Windows7 64b + JDK7 32b + message = Messages.ExceptionNotifier_JRE_1_7_IS_NOT_SUPPORTED_ON_WINDOWS; } else if (PlatformUtil.OS_LINUX.equals(os) && error.getMessage() != null) { // Linux - probably WebKitGTK is not installed message = MessageFormat.format(Messages.ExceptionNotifier_BROWSERSIM_IS_FAILED_TO_START_ON_LINUX, error.getMessage()); } else { // everything else Index: src/org/jboss/tools/vpe/browsersim/ui/Messages.java =================================================================== --- src/org/jboss/tools/vpe/browsersim/ui/Messages.java (revision 43326) +++ src/org/jboss/tools/vpe/browsersim/ui/Messages.java (working copy) @@ -17,7 +17,6 @@ */ public class Messages { private static final String BUNDLE_NAME = Messages.class.getName().toString().toLowerCase(); - public static String BrowserSim_ABOUT; public static String BrowserSim_ABOUT_MESSAGE; @@ -49,6 +48,7 @@ public static String ExceptionNotifier_APPLE_APPLICATION_SUPPORT_IS_NOT_FOUND; public static String ExceptionNotifier_BROWSERSIM_IS_FAILED_TO_START; public static String ExceptionNotifier_BROWSERSIM_IS_FAILED_TO_START_ON_LINUX; + public static String ExceptionNotifier_JRE_1_7_IS_NOT_SUPPORTED_ON_WINDOWS; public static String ExceptionNotifier_OK; public static String ExceptionNotifier_ONLY_32_BIT_ECLIPSE_IS_SUPPORTED_ON_WINDOWS; public static String ManageDevicesDialog_ADD; #P org.jboss.tools.vpe.browsersim.eclipse Index: src/org/jboss/tools/vpe/browsersim/eclipse/util/BrowserSimLauncher.java =================================================================== --- src/org/jboss/tools/vpe/browsersim/eclipse/util/BrowserSimLauncher.java (revision 43326) +++ src/org/jboss/tools/vpe/browsersim/eclipse/util/BrowserSimLauncher.java (working copy) @@ -55,6 +55,20 @@ String classPath = getClassPathString(); String javaCommand = System.getProperty("java.home") + "/bin/java"; //$NON-NLS-1$ //$NON-NLS-2$ + // This is a workaround for JDK 7: JBIDE-12467 Unable to Run Browsersim in Windows7 64b + JRE7 32b + // On Windows and Java 7 the 'java.home' variable always points to JRE, but 'eclipse.vm' may point to JDK, + // if it is specified explicitly in the inclipse.ini. + boolean isJava1_7 = "1.7".equals(System.getProperty("java.specification.version")); //$NON-NLS-1$ //$NON-NLS-2$ + if (Platform.OS_WIN32.equals(Platform.getOS()) && isJava1_7) { + String eclipseVm = System.getProperty("eclipse.vm"); + if (eclipseVm != null) { + if (eclipseVm.endsWith("java") || eclipseVm.endsWith("java.exe") + || eclipseVm.endsWith("javaw") || eclipseVm.endsWith("javaw.exe")) { + javaCommand = eclipseVm; + } + } + } + List commandElements = new ArrayList(); commandElements.add(javaCommand); if (Platform.OS_MACOSX.equals(Platform.getOS())) {