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 202834 Details for
Bug 327193
[patch] Launching command line exceeds the process creation command limit on Windows
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch for long classpath on windows
long-cp.patch (text/plain), 3.39 KB, created by
leniviy
on 2011-09-06 14:22:29 EDT
(
hide
)
Description:
patch for long classpath on windows
Filename:
MIME Type:
Creator:
leniviy
Created:
2011-09-06 14:22:29 EDT
Size:
3.39 KB
patch
obsolete
>diff -ur org.eclipse.jdt.launching.1/META-INF/MANIFEST.MF org.eclipse.jdt.launching/META-INF/MANIFEST.MF >--- org.eclipse.jdt.launching.1/META-INF/MANIFEST.MF 2011-09-06 21:36:07.664703000 +0400 >+++ org.eclipse.jdt.launching/META-INF/MANIFEST.MF 2011-09-06 21:43:17.354279900 +0400 >@@ -19,6 +19,7 @@ > org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)", > org.eclipse.osgi;bundle-version="[3.8.0,4.0.0)", >+ org.apache.ant;bundle-version="1.7.1", > org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)" > Bundle-ActivationPolicy: lazy > Import-Package: com.ibm.icu.text >diff -ur org.eclipse.jdt.launching.1/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java >--- org.eclipse.jdt.launching.1/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java 2011-09-06 21:36:14.731107200 +0400 >+++ org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMDebugger.java 2011-09-06 21:42:07.163265200 +0400 >@@ -19,6 +19,10 @@ > import java.util.List; > import java.util.Map; > >+import org.apache.tools.ant.taskdefs.Jar; >+import org.apache.tools.ant.taskdefs.Manifest; >+import org.apache.tools.ant.taskdefs.Manifest.Attribute; >+import org.apache.tools.ant.taskdefs.ManifestException; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IProgressMonitor; >@@ -204,8 +208,10 @@ > addBootClassPathArguments(arguments, config); > > String[] cp= config.getClassPath(); >+ int classpathArgIndex = -1; > if (cp.length > 0) { > arguments.add("-classpath"); //$NON-NLS-1$ >+ classpathArgIndex = arguments.size(); > arguments.add(convertClassPath(cp)); > } > >@@ -213,6 +219,50 @@ > > arguments.add(config.getClassToLaunch()); > addArguments(config.getProgramArguments(), arguments); >+ >+ if (classpathArgIndex > -1 >+ && ((String)arguments.get(classpathArgIndex)).length() > 256 // can be shortened >+ && File.separatorChar == '\\' // is Windows >+ ) >+ { >+ int cmdLen = 0; >+ for (int i = 0, sz = arguments.size(); i < sz; i++) { >+ cmdLen += ((String)arguments.get(i)).length() + 1; >+ } >+ if (cmdLen > 30000) { >+ Jar jar = new Jar(); >+ Manifest mf = new Manifest(); >+ List shortCp = new ArrayList(); >+ int jarCount = 0; >+ StringBuffer sb = new StringBuffer(cmdLen); >+ for (int i = 0; i < cp.length; i++) { >+ String cpEntry = cp[i]; >+ File f; >+ if (cpEntry.toLowerCase().endsWith(".jar") && (f = new File(cpEntry)).isAbsolute()) { >+ sb.append(f.toURI().toString()); >+ sb.append(' '); >+ jarCount++; >+ } else { >+ shortCp.add(cpEntry); >+ } >+ } >+ if (jarCount > 0) { >+ Attribute attr = new Attribute(Manifest.ATTRIBUTE_CLASSPATH, sb.toString()); >+ try { >+ mf.addConfiguredAttribute(attr); >+ jar.addConfiguredManifest(mf); >+ String jarPath = File.createTempFile("classpath", ".jar").getAbsolutePath(); >+ jar.setDestFile(new File(jarPath)); >+ jar.execute(); >+ shortCp.add(jarPath); >+ String[] shortCpA = new String[shortCp.size()]; >+ shortCp.toArray(shortCpA); >+ arguments.set(classpathArgIndex, convertClassPath(shortCpA)); >+ } catch(Exception e) { >+ } >+ } >+ } >+ } > String[] cmdLine= new String[arguments.size()]; > arguments.toArray(cmdLine); >
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 327193
:
202740
|
202834
|
205716
|
216593
|
216637
|
218765
|
218771
|
218816
|
218870
|
219900
|
249143