Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 227141 Details for
Bug 368483
Mac OSX JDT launching plugin needs to check new VM locations on Snow Leopard and Lion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
work in progress
eclipse.jdt.debug.mac.vm.patch (text/plain), 3.80 KB, created by
Michael Rennie
on 2013-02-15 12:13:55 EST
(
hide
)
Description:
work in progress
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2013-02-15 12:13:55 EST
Size:
3.80 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java >index 0007690..2cf6540 100644 >--- a/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java >+++ b/org.eclipse.jdt.launching.macosx/macosx/org/eclipse/jdt/internal/launching/macosx/MacOSXVMInstallType.java >@@ -61,7 +61,7 @@ > * src.zip > * </pre> > * >- * The directory structure for Snow Leopard and Lion VMs is: >+ * The directory structure for Snow Leopard and Lion VMs is: > * <pre> > * /System/Library/Java/JavaVirtualMachines/ > * 1.6.0.jdk/ >@@ -84,6 +84,21 @@ > private static final String JAVADOC_LOC= "/Developer/Documentation/Java/Reference/"; //$NON-NLS-1$ > /** The doc for 1.4.1 is kept in a sub directory of the above. */ > private static final String JAVADOC_SUBDIR= "/doc/api"; //$NON-NLS-1$ >+ /** >+ * The name of the src.zip file for the JDK source >+ * @since 3.2.200 >+ */ >+ static final String SRC_ZIP = "src.zip"; //$NON-NLS-1$ >+ /** >+ * The name of the source used for libraries on the Mac >+ * @since 3.2.200 >+ */ >+ static final String SRC_NAME = "src"; //$NON-NLS-1$ >+ /** >+ * The name of the Contents folder found within a JRE/JDK folder >+ * @since 3.2.200 >+ */ >+ static final String JVM_CONTENTS = "Contents"; //$NON-NLS-1$ > > @Override > public String getName() { >@@ -147,18 +162,15 @@ > * @return file that points to the default JRE install > */ > private File detectInstallLocationOld() { >- > String javaVMName= System.getProperty("java.vm.name"); //$NON-NLS-1$ > if (javaVMName == null) { > return null; > } >- > if (!JVM_VERSIONS_FOLDER.exists() || !JVM_VERSIONS_FOLDER.isDirectory()) { > String message= NLS.bind(MacOSXLaunchingPlugin.getString("MacOSXVMType.error.jvmDirectoryNotFound"), JVM_VERSIONS_FOLDER); //$NON-NLS-1$ > LaunchingPlugin.log(message); > return null; > } >- > // find all installed VMs > File defaultLocation= null; > File[] versions= getAllVersionsOld(); >@@ -232,6 +244,11 @@ > */ > @Override > protected LibraryInfo getDefaultLibraryInfo(File installLocation) { >+ IPath rtjar = getDefaultSystemLibrary(installLocation); >+ if(rtjar.toFile().isFile()) { >+ //not a Mac OS VM, default to the standard VM type info collection >+ return super.getDefaultLibraryInfo(installLocation); >+ } > File classes = new File(installLocation, "../Classes"); //$NON-NLS-1$ > File lib1= new File(classes, "classes.jar"); //$NON-NLS-1$ > File lib2= new File(classes, "ui.jar"); //$NON-NLS-1$ >@@ -261,21 +278,20 @@ > */ > @Override > protected IPath getDefaultSystemLibrarySource(File libLocation) { >- File parent= libLocation.getParentFile(); >- while (parent != null) { >- File home= new File(parent, JVM_HOME); >- File parentsrc= new File(home, "src.jar"); //$NON-NLS-1$ >- if (parentsrc.isFile()) { >- setDefaultRootPath("src");//$NON-NLS-1$ >- return new Path(parentsrc.getPath()); >- } >- parentsrc= new File(home, "src.zip"); //$NON-NLS-1$ >- if (parentsrc.isFile()) { >- setDefaultRootPath(""); //$NON-NLS-1$ >- return new Path(parentsrc.getPath()); >+ File parent = libLocation.getParentFile(); >+ File src = null; >+ //walk the parent hierarchy, stop if we run out of parents or we hit the /Contents dir >+ while (parent != null && !JVM_CONTENTS.equals(parent.getName())) { >+ src = new File(parent, SRC_ZIP); >+ if (src.isFile()) { >+ setDefaultRootPath(SRC_NAME); >+ return new Path(src.getPath()); > } > parent = parent.getParentFile(); > } >+ //in very old VM cases ~1.3/1.4 the /Home dir is co-located to the /Classes dir >+ //should we add a fall-back case for this? those VMs cannot be installed on a Mac >+ //any longer > setDefaultRootPath(""); //$NON-NLS-1$ > return Path.EMPTY; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 368483
:
209410
|
209411
|
209412
|
209413
|
209414
| 227141