Importing libraries in eclipse programmatically
- by Krt_Malta
Hi,
Is there a way I could put a library (Jar file) into an Eclipse project programatically? Up to now I've managed to do an external reference to it programatically using
IPath path = new Path("C:\\Hello\\jtwitter.jar");
libraries.add(JavaCore.newLibraryEntry(path, null, null));
//add libs to project class path
try {
javaProject.setRawClasspath(libraries.toArray(new IClasspathEntry[libraries.size()]), null);
} catch (JavaModelException e1) {
e1.printStackTrace();
}
}
however I'd like to copy the jtwitter file to the project folder programatically so I could reference it as jtwitter.jar only. Can this be done please?
Thanks a lot and regards,
Krt_Malta