public static void addRawClassPathEntry(IJavaProject javaProject,IClasspathEntry rawClasspathEntry) throws JavaModelException {
  IClasspathEntry[] oldEntries=javaProject.getRawClasspath();
  IProgressMonitor monitor=new NullProgressMonitor();
  List<IClasspathEntry> newEntries=new ArrayList<IClasspathEntry>(Arrays.asList(oldEntries));
  newEntries.add(rawClasspathEntry);
  javaProject.setRawClasspath(newEntries.toArray(NO_ICLASSPATH_ENTRIES),monitor);
}

public static void addRawClassPathEntry ( IJavaProject javaProject , IClasspathEntry rawClasspathEntry ) throws JavaModelException { IClasspathEntry [ ] oldEntries = javaProject . getRawClasspath ( ) ; IProgressMonitor monitor = new NullProgressMonitor ( ) ; List < IClasspathEntry > newEntries = new ArrayList < IClasspathEntry > ( Arrays . asList ( oldEntries ) ) ; newEntries . add ( rawClasspathEntry ) ; javaProject . setRawClasspath ( newEntries . toArray ( NO_ICLASSPATH_ENTRIES ) , monitor ) ; }
adds the specified classpath to the java project ' s existing classpath .
