/** * Add bootclasspath tag to given javaElement. */ private void addRuntimeBootClasspath(ILaunchConfiguration conf, Element javaElement) throws CoreException { // <bootclasspath> // <path refid="run.hello.bootclasspath"/> // </bootclasspath> if (JavaRuntime.isModularConfiguration(conf)) { // there is no bootclasspath entry from Java 9 onwards return; } EclipseClasspath bootClasspath = new EclipseClasspath(project, conf, true); if (bootClasspath.rawClassPathEntries.size() == 1 && EclipseClasspath.isJreReference(bootClasspath.rawClassPathEntries.get(0))) { // the default boot classpath contains exactly one element (the JRE) return; } String pathId = "run." + conf.getName() + ".bootclasspath"; //$NON-NLS-1$ //$NON-NLS-2$ createClasspaths(pathId, project, bootClasspath); Element bootclasspath = doc.createElement("bootclasspath"); //$NON-NLS-1$ Element classpathRefElement = doc.createElement("path"); //$NON-NLS-1$ classpathRefElement.setAttribute("refid", pathId); //$NON-NLS-1$ bootclasspath.appendChild(classpathRefElement); javaElement.appendChild(bootclasspath); }
private static IPath[] getClasspath(ILaunchConfiguration configuration) throws CoreException { IRuntimeClasspathEntry[] entries= JavaRuntime.computeUnresolvedRuntimeClasspath(configuration); entries= JavaRuntime.resolveRuntimeClasspath(entries, configuration); ArrayList<IPath> userEntries= new ArrayList<>(entries.length); boolean isModularConfig= JavaRuntime.isModularConfiguration(configuration); for (int i= 0; i < entries.length; i++) { int classPathProperty= entries[i].getClasspathProperty(); if ((!isModularConfig && classPathProperty == IRuntimeClasspathEntry.USER_CLASSES) || (isModularConfig && (classPathProperty == IRuntimeClasspathEntry.CLASS_PATH || classPathProperty == IRuntimeClasspathEntry.MODULE_PATH))) { String location= entries[i].getLocation(); if (location != null) { IPath entry= Path.fromOSString(location); if (!userEntries.contains(entry)) { userEntries.add(entry); } } } } return userEntries.toArray(new IPath[userEntries.size()]); }
private static IPath[] getClasspath(ILaunchConfiguration configuration) throws CoreException { IRuntimeClasspathEntry[] entries= JavaRuntime.computeUnresolvedRuntimeClasspath(configuration); entries= JavaRuntime.resolveRuntimeClasspath(entries, configuration); boolean isModularConfig= JavaRuntime.isModularConfiguration(configuration); ArrayList<IPath> userEntries= new ArrayList<>(entries.length); for (int i= 0; i < entries.length; i++) { int classPathProperty= entries[i].getClasspathProperty(); if ((!isModularConfig && classPathProperty == IRuntimeClasspathEntry.USER_CLASSES) || (isModularConfig && (classPathProperty == IRuntimeClasspathEntry.CLASS_PATH || classPathProperty == IRuntimeClasspathEntry.MODULE_PATH))) { String location= entries[i].getLocation(); if (location != null) { IPath entry= Path.fromOSString(location); if (!userEntries.contains(entry)) { userEntries.add(entry); } } } } return userEntries.toArray(new IPath[userEntries.size()]); }
protected IPath[] getClasspath(ILaunchConfiguration configuration) throws CoreException { IRuntimeClasspathEntry[] entries= JavaRuntime.computeUnresolvedRuntimeClasspath(configuration); entries= JavaRuntime.resolveRuntimeClasspath(entries, configuration); boolean isModularConfig= JavaRuntime.isModularConfiguration(configuration); ArrayList<IPath> userEntries= new ArrayList<>(entries.length); for (int i= 0; i < entries.length; i++) { int classPathProperty= entries[i].getClasspathProperty(); if ((!isModularConfig && classPathProperty == IRuntimeClasspathEntry.USER_CLASSES) || (isModularConfig && (classPathProperty == IRuntimeClasspathEntry.CLASS_PATH || classPathProperty == IRuntimeClasspathEntry.MODULE_PATH))) { String location= entries[i].getLocation(); if (location != null) { IPath entry= Path.fromOSString(location); if (!userEntries.contains(entry)) { userEntries.add(entry); } } } } return userEntries.toArray(new IPath[userEntries.size()]); }
@Override protected IPath[] getClasspath(ILaunchConfiguration configuration) throws CoreException { IRuntimeClasspathEntry[] entries = AbstractSARLLaunchConfigurationDelegate.computeUnresolvedSARLRuntimeClasspath( configuration, this.configAccessor, cfg -> getJavaProject(cfg)); entries = JavaRuntime.resolveRuntimeClasspath(entries, configuration); final boolean isModularConfig = JavaRuntime.isModularConfiguration(configuration); final List<IPath> userEntries = new ArrayList<>(entries.length); for (int i = 0; i < entries.length; i++) { final int classPathProperty = entries[i].getClasspathProperty(); if ((!isModularConfig && classPathProperty == IRuntimeClasspathEntry.USER_CLASSES) || (isModularConfig && (classPathProperty == IRuntimeClasspathEntry.CLASS_PATH || classPathProperty == IRuntimeClasspathEntry.MODULE_PATH))) { final String location = entries[i].getLocation(); if (location != null) { final IPath entry = Path.fromOSString(location); if (!userEntries.contains(entry)) { userEntries.add(entry); } } } } return userEntries.toArray(new IPath[userEntries.size()]); }
if (JavaRuntime.isModularConfiguration(configuration)) { return null;
/** Replies the preferred tab for configuring the classpath. * The tab may be the standard {@link JavaClasspathTab} or its specialization * {@link JavaDependenciesTab}. * * @param dialog the dialog that will contains the tab. * @return the tab instance, never {@code null}. */ protected static JavaClasspathTab getClasspathTab(ILaunchConfigurationDialog dialog) { JavaClasspathTab tab = null; if (dialog instanceof LaunchConfigurationsDialog) { final LaunchConfigurationTabGroupViewer tabViewer = ((LaunchConfigurationsDialog) dialog).getTabViewer(); if (tabViewer != null) { final Object input = tabViewer.getInput(); if (input instanceof ILaunchConfiguration) { final ILaunchConfiguration configuration = (ILaunchConfiguration) input; if (JavaRuntime.isModularConfiguration(configuration)) { tab = new JavaDependenciesTab(); } } } } if (tab == null) { tab = new JavaClasspathTab(); } return tab; }
if (isModularConfiguration(configuration)) { IRuntimeClasspathEntry[] entries1 = getClasspathProvider(configuration).resolveClasspath(entries, configuration); ArrayList<IRuntimeClasspathEntry> entries2 = new ArrayList<>(entries1.length);
@Override public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException { boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true); boolean isModular = JavaRuntime.isModularConfiguration(configuration); boolean excludeTestCode = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_EXCLUDE_TEST_CODE, false); if (useDefault) {
if (!JavaRuntime.isModularConfiguration(configuration)) {
runConfig.setVMSpecificAttributesMap(vmAttributesMap); if (!JavaRuntime.isModularConfiguration(configuration)) {
containerPath = newDefaultJREContainerPath(); } else { if (isModularConfiguration(configuration)) { return computeModularJREEntry(proj); if (isModularConfiguration(configuration)) { return newRuntimeContainerClasspathEntry(containerPath, IRuntimeClasspathEntry.MODULE_PATH);
if (!JavaRuntime.isModularConfiguration(configuration)) {