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 3837 Details for
Bug 33475
Build path seems to be lost every time Eclipse restarts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
EclipseHomeInitializer
EclipseHomeInitializer.java (text/plain), 2.16 KB, created by
Wassim Melhem
on 2003-03-04 18:43:27 EST
(
hide
)
Description:
EclipseHomeInitializer
Filename:
MIME Type:
Creator:
Wassim Melhem
Created:
2003-03-04 18:43:27 EST
Size:
2.16 KB
patch
obsolete
>/** > * Created on Apr 10, 2002 > * > * To change this generated comment edit the template variable "filecomment": > * Workbench>Preferences>Java>Templates. > */ >package org.eclipse.pde.internal.core; > > >import java.io.File; > >import org.eclipse.core.runtime.IPath; >import org.eclipse.core.runtime.Path; >import org.eclipse.core.runtime.Preferences; >import org.eclipse.jdt.core.ClasspathVariableInitializer; >import org.eclipse.jdt.core.JavaCore; >import org.eclipse.jdt.core.JavaModelException; > >/** > * > */ >public class EclipseHomeInitializer extends ClasspathVariableInitializer { > > /** > * Constructor for EclipseHomeInitializer. > */ > public EclipseHomeInitializer() { > super(); > } > > /** > * @see ClasspathVariableInitializer#initialize(String) > */ > public void initialize(String variable) { > resetEclipseHomeVariables(); > } > > public static void resetEclipseHomeVariables() { > String[] variables = JavaCore.getClasspathVariableNames(); > > // Remove all ECLIPSE_HOME* variables (except for ECLIPSE_HOME) > for (int i = 0; i < variables.length; i++) { > if (variables[i].startsWith(PDECore.ECLIPSE_HOME_VARIABLE) > && !variables[i].equals(PDECore.ECLIPSE_HOME_VARIABLE)) { > JavaCore.removeClasspathVariable(variables[i], null); > } > } > try { > // Initialize the ECLIPSE_HOME variable > Preferences pref = PDECore.getDefault().getPluginPreferences(); > String platformHome = pref.getString(ICoreConstants.PLATFORM_PATH); > JavaCore.setClasspathVariable( > PDECore.ECLIPSE_HOME_VARIABLE, > new Path(platformHome), > null); > > // Go through all the link files, and create an ECLIPSE_HOME_* variable > // for every link. > File[] linkFiles = PluginPathFinder.getLinkFiles(platformHome); > if (linkFiles != null) { > for (int i = 0; i < linkFiles.length; i++) { > String path = PluginPathFinder.getPath(platformHome, linkFiles[i]); > if (path != null) { > String variable = > PDECore.ECLIPSE_HOME_VARIABLE + "_" > + linkFiles[i].getName().replace('.', '_').toUpperCase(); > JavaCore.setClasspathVariable(variable, new Path(path), null); > } > } > } > } catch (JavaModelException e) { > } > } >}
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 Raw
Actions:
View
Attachments on
bug 33475
:
3828
| 3837