|
|
|
Re: How to get a list of jars in a project's classPath [message #330731 is a reply to message #330723] |
Tue, 12 August 2008 11:48 |
Ed Merks Messages: 33236 Registered: July 2009 |
Senior Member |
|
|
Prasanna,
I'm not an expert on this by any means. I just snipped some code from
one of the classes I on in the past to help get you started. It's been
a while since I looked at code for this...
Prasanna wrote:
> Hi Ed,
> Thanks for your reply.
> After going through the code snippet you had posted, I checked out the
> javadoc for IClasspathEntry.
> This is how I got full paths (on file system) of all the jars on the
> classPath of the selected project :
>
> List<String> classPathEntriesList = new ArrayList<String>();
> IJavaProject javaProject = JavaCore.create(project);
> IClasspathEntry[] classPathEntries = javaProject.getRawClasspath();
> for(IClasspathEntry classPathEntry : classPathEntries) {
> if( classPathEntry.getContentKind() ==
> IPackageFragmentRoot.K_BINARY)
> classPathEntriesList.add(classPathEntry.getPath().toString() );
> }
> for(ListIterator<String> it = classPathEntriesList.listIterator();
> it.hasNext();) {
> classPath += it.next();
> if(it.hasNext())
> classPath += ";";
> }
>
> This link helped me :
> http://dev.eclipse.org/newslists/news.eclipse.platform/msg69 997.html
>
> I'd like to know What do I stand to loose if I don't follow the
> road-map shown by you.
>
> Thanks.
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03733 seconds