Package org.eclipse.jdt.launching

Examples of org.eclipse.jdt.launching.IRuntimeClasspathEntry


    List<String> classpathMementos = new ArrayList<String>();
   
    Iterator<IPath> classPathEntries = classpath.iterator();
    while (classPathEntries.hasNext()) {
      IPath cpPath = classPathEntries.next();
      IRuntimeClasspathEntry cpEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(cpPath);   
      cpEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
      classpathMementos.add(cpEntry.getMemento());
    }
   
    if (bootClasspath.length == 0) {   
      IPath systemLibsPath = new Path(JavaRuntime.JRE_CONTAINER);
      IRuntimeClasspathEntry systemLibsEntry = JavaRuntime.newRuntimeContainerClasspathEntry(systemLibsPath,IRuntimeClasspathEntry.STANDARD_CLASSES);
      classpathMementos.add(systemLibsEntry.getMemento());
    } else {
      for (int i = 0; i < bootClasspath.length; i++) {
        IRuntimeClasspathEntry cpEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(bootClasspath[i]));
        cpEntry.setClasspathProperty(IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
        classpathMementos.add(cpEntry.getMemento());
      }
    }

    config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
    config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpathMementos);
View Full Code Here


  public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor)
      throws CoreException {
    List<IRuntimeClasspathEntry> entries = new ArrayList<IRuntimeClasspathEntry>();

    IRuntimeClasspathEntry jreEntry = JavaRuntime.computeJREEntry(configuration);
    if (jreEntry != null) {
      entries.add(jreEntry);
    }

    String projectName = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
View Full Code Here

  protected void computeRuntimeClassPath() throws CoreException {
    runtimeDependencies = new ArrayList<String>();

    IRuntimeClasspathEntry[] unresolved = JavaRuntime
        .computeUnresolvedRuntimeClasspath(javaProject);
    IRuntimeClasspathEntry jreEntry = JavaRuntime
        .computeJREEntry(javaProject);
    List<IRuntimeClasspathEntry> resolved = new ArrayList<IRuntimeClasspathEntry>();

    // Resolve all runtime entries, and skip the jre entry
    for (IRuntimeClasspathEntry rcEntry : unresolved) {
View Full Code Here

            dynamic = new HashSet<IRuntimeClasspathEntry>();
            dynamicRuntime.put(config, dynamic);
        }

        IJavaProject javaProject = project.getJavaModel();
        IRuntimeClasspathEntry cp = JavaRuntime.newProjectRuntimeClasspathEntry(javaProject);

        dynamic.add(cp);
    }
View Full Code Here

        // Creating the classpath list
        List<String> classpath = new ArrayList<String>();
        for ( String library : libraries )
        {
            IRuntimeClasspathEntry libraryClasspathEntry = JavaRuntime
                .newArchiveRuntimeClasspathEntry( getServerLibrariesFolder().append( library ) );
            libraryClasspathEntry.setClasspathProperty( IRuntimeClasspathEntry.USER_CLASSES );

            classpath.add( libraryClasspathEntry.getMemento() );
        }

        // Setting the classpath type attribute
        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath );
View Full Code Here

  public void launch() throws CoreException{
    DerbyPlugin plugin = DerbyPlugin.getDefault();

    // constructs a classpath from the default JRE...
    IPath systemLibs = new Path(JavaRuntime.JRE_CONTAINER);
    IRuntimeClasspathEntry systemLibsEntry = JavaRuntime.newRuntimeContainerClasspathEntry(
      systemLibs, IRuntimeClasspathEntry.STANDARD_CLASSES);
    systemLibsEntry.setClasspathProperty(IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
    //include org.apache.derby.core plugin
    IRuntimeClasspathEntry derbyCPEntry = null;
    List classpath = new ArrayList();
    classpath.add(systemLibsEntry.getMemento());
   
    try {
      ManifestElement[] elements_core, elements_ui;
      elements_core = getElements(CommonNames.CORE_PATH);
      elements_ui=getElements(CommonNames.UI_PATH);
     
      Bundle bundle;
      URL pluginURL,jarURL,localURL;
      bundle=Platform.getBundle(CommonNames.CORE_PATH);
      pluginURL = bundle.getEntry("/");
      for(int i=0;i<elements_core.length;i++){
        if(!elements_core[i].getValue().toLowerCase().endsWith("derbynet.jar")){
          jarURL= new URL(pluginURL,elements_core[i].getValue());
          localURL=Platform.asLocalURL(jarURL);
          derbyCPEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(localURL.getPath()));
          derbyCPEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
          classpath.add(derbyCPEntry.getMemento());
        }
      }
      bundle=Platform.getBundle(CommonNames.CORE_PATH);
      pluginURL = bundle.getEntry("/");
      for(int i=0;i<elements_ui.length;i++){
        if(!elements_ui[i].getValue().toLowerCase().equals("ui.jar")){
          jarURL= new URL(pluginURL,elements_ui[i].getValue());
          localURL=Platform.asLocalURL(jarURL);
          derbyCPEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(localURL.getPath()));
          derbyCPEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
          classpath.add(derbyCPEntry.getMemento());
        }
      }
    }
    catch(Exception e) {
      e.printStackTrace();
View Full Code Here

                IProject p = ResourcesPlugin.getWorkspace().getRoot()
                        .getProject(cpe.getPath().segment(0));
                IJavaProject jp = JavaCore.create(p);
                if (!projects.contains(jp)) {
                    projects.add(jp);
                    IRuntimeClasspathEntry classpath = JavaRuntime
                            .newProjectRuntimeClasspathEntry(jp);
                    resolved.add(classpath);
                    IRuntimeClasspathEntry[] entries = JavaRuntime.resolveRuntimeClasspathEntry(
                        classpath, jp);
                    for (int j = 0; j < entries.length; j++) {
                        IRuntimeClasspathEntry e = entries[j];
                        if (!resolved.contains(e)) {
                            resolved.add(entries[j]);
                        }
                    }
                }
            } else if (cpe.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
                IRuntimeClasspathEntry e = JavaRuntime.newArchiveRuntimeClasspathEntry(cpe
                        .getPath());
                if (!resolved.contains(e)) {
                    resolved.add(e);
                }
            }
View Full Code Here

            // Creating the classpath list
            List<String> classpath = new ArrayList<String>();
            IPath apacheDsLibrariesFolder = ApacheDsPluginUtils.getApacheDsLibrariesFolder( server );
            for ( String library : ApacheDsPluginUtils.getApacheDsLibraries( server ) )
            {
                IRuntimeClasspathEntry libraryClasspathEntry = JavaRuntime
                    .newArchiveRuntimeClasspathEntry( apacheDsLibrariesFolder.append( library ) );
                libraryClasspathEntry.setClasspathProperty( IRuntimeClasspathEntry.USER_CLASSES );

                classpath.add( libraryClasspathEntry.getMemento() );
            }

            // Setting the classpath type attribute
            workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath );
View Full Code Here

      iConfWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);

      List<String> classPath = new ArrayList<String>();
      IResource resource = type.getResource();
      IJavaProject project = (IJavaProject) resource.getProject().getNature(JavaCore.NATURE_ID);
      IRuntimeClasspathEntry cpEntry = JavaRuntime.newDefaultProjectClasspathEntry(project);
      classPath.add(0, cpEntry.getMemento());

      iConfWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classPath);

    } catch (CoreException e) {
      e.printStackTrace();
View Full Code Here

    // Setup the Launch class path
    List<String> classPath;
    try {
      classPath = iConf.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, new ArrayList());
      IPath confIPath = new Path(confDir.getAbsolutePath());
      IRuntimeClasspathEntry cpEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(confIPath);
      classPath.add(0, cpEntry.getMemento());
      iConf.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classPath);
      iConf.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, mainPage.argumentsText.getText());

    } catch (CoreException e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.launching.IRuntimeClasspathEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.