Lines 643-655
Link Here
|
643 |
System.out.println("("+(System.currentTimeMillis()-start)+"ms)"); |
643 |
System.out.println("("+(System.currentTimeMillis()-start)+"ms)"); |
644 |
|
644 |
|
645 |
// Create lib entries for the JDKs |
645 |
// Create lib entries for the JDKs |
|
|
646 |
String jreLibPath = JavaCore.getClasspathVariable("JRE_LIB").toOSString(); |
646 |
System.out.print("Create lib entries for the JDKs..."); |
647 |
System.out.print("Create lib entries for the JDKs..."); |
647 |
start = System.currentTimeMillis(); |
648 |
start = System.currentTimeMillis(); |
648 |
String[] jdkLibs = Util.getJavaClassLibs(); |
649 |
String[] jdkLibs = Util.getJavaClassLibs(); |
649 |
int jdkLibsLength = jdkLibs.length; |
650 |
int jdkLibsLength = jdkLibs.length; |
650 |
IClasspathEntry[] jdkEntries = new IClasspathEntry[jdkLibsLength]; |
651 |
IClasspathEntry[] jdkEntries = new IClasspathEntry[jdkLibsLength]; |
|
|
652 |
int jdkEntriesCount = 0; |
651 |
for (int i=0; i<jdkLibsLength; i++) { |
653 |
for (int i=0; i<jdkLibsLength; i++) { |
652 |
jdkEntries[i] = JavaCore.newLibraryEntry(new Path(jdkLibs[i]), null, null); |
654 |
if (!jdkLibs[i].equals(jreLibPath)) { // do not include JRE_LIB in additional JDK entries |
|
|
655 |
jdkEntries[jdkEntriesCount++] = JavaCore.newLibraryEntry(new Path(jdkLibs[i]), null, null); |
656 |
} |
653 |
} |
657 |
} |
654 |
System.out.println(jdkLibsLength+" found ("+(System.currentTimeMillis()-start)+"ms)"); |
658 |
System.out.println(jdkLibsLength+" found ("+(System.currentTimeMillis()-start)+"ms)"); |
655 |
|
659 |
|
Lines 670-678
Link Here
|
670 |
// Set jdk jars onto the project classpath |
674 |
// Set jdk jars onto the project classpath |
671 |
IClasspathEntry[] entries = ALL_PROJECTS[i].getRawClasspath(); |
675 |
IClasspathEntry[] entries = ALL_PROJECTS[i].getRawClasspath(); |
672 |
int entriesLength = entries.length; |
676 |
int entriesLength = entries.length; |
673 |
if (!entries[0].equals(jdkEntries[0])) { |
677 |
if (!entries[entriesLength-1].equals(jdkEntries[jdkEntriesCount-1])) { |
674 |
System.arraycopy(entries, 0, entries = new IClasspathEntry[jdkLibsLength+entriesLength], jdkLibsLength, entriesLength); |
678 |
System.arraycopy(entries, 0, entries = new IClasspathEntry[jdkEntriesCount+entriesLength], 0, entriesLength); |
675 |
System.arraycopy(jdkEntries, 0, entries, 0, jdkLibsLength); |
679 |
System.arraycopy(jdkEntries, 0, entries, entriesLength, jdkEntriesCount); |
676 |
ALL_PROJECTS[i].setRawClasspath(entries, null); |
680 |
ALL_PROJECTS[i].setRawClasspath(entries, null); |
677 |
} |
681 |
} |
678 |
|
682 |
|