How to add jar to .classpath [message #289063] |
Thu, 28 July 2005 12:10 |
Eclipse User |
|
|
|
Originally posted by: andreas140983.libero.it
I have create a plugin that in one of his functionality it add to the
classpath file of an existent project any library.
How to do this?
There is any method associated to the IProject that I can use?
Excuse for my English but I come from Italy!
Thanks, Andrea
|
|
|
|
|
Re: How to add jar to .classpath [message #289106 is a reply to message #289100] |
Fri, 29 July 2005 10:56 |
Eclipse User |
|
|
|
Originally posted by: andreas140983.libero.it
Excuse me but I have an error when I would use the IJavaProject.
I write this code:
IJavaProject JavaProject=
(IJavaProject)ResourcesPlugin.getWorkspace().getRoot().getPr oject( "name of
my project");
this line cause an error in my code and I don't say why!
You can help me?
|
|
|
Re: How to add jar to .classpath [message #289111 is a reply to message #289106] |
Fri, 29 July 2005 14:24 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
getProject() returns an IProject, not an IJavaProject so you are getting
a ClassCastException.
To get the IJavaProject from an IProject you would do
JavaCore.create(IProject).
Andrea Sichel wrote:
> Excuse me but I have an error when I would use the IJavaProject.
>
> I write this code:
> IJavaProject JavaProject=
> (IJavaProject)ResourcesPlugin.getWorkspace().getRoot().getPr oject( "name
> of my project");
>
> this line cause an error in my code and I don't say why!
>
> You can help me?
>
--
Thanks,
Rich Kulp
|
|
|
Re: How to add jar to .classpath [message #289119 is a reply to message #289111] |
Fri, 29 July 2005 16:10 |
Eclipse User |
|
|
|
Originally posted by: andreas140983.libero.it
Thanks very much!!
I have resolved this problem but I have another problem:
how I can control if a library is already present before I try to insert
it?
In other words if, for example, the project created by a user has already
the library "soap.jar" and with my plugin I would to insert the same
"soap.jar", eclipse return me an error and stop the execution of my plugin.
How I can control if this library is already present?
Excuse me for my bad English but I'm Italian!
Thanks, Andrea
|
|
|
Re: How to add jar to .classpath [message #289121 is a reply to message #289119] |
Fri, 29 July 2005 16:18 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You need to get the classpath entries from the IJavaProject and see if
already there.
Andrea Sichel wrote:
> Thanks very much!!
>
> I have resolved this problem but I have another problem:
>
> how I can control if a library is already present before I try to insert
> it?
>
> In other words if, for example, the project created by a user has
> already the library "soap.jar" and with my plugin I would to insert the
> same "soap.jar", eclipse return me an error and stop the execution of my
> plugin.
> How I can control if this library is already present?
>
> Excuse me for my bad English but I'm Italian!
>
> Thanks, Andrea
--
Thanks,
Rich Kulp
|
|
|
Re: How to add jar to .classpath [message #289142 is a reply to message #289121] |
Sat, 30 July 2005 13:54 |
Eclipse User |
|
|
|
Originally posted by: andreas140983.libero.it
But I have to control the entirely path of the library that I would to
insert or only the name of the library?
In other words, if I have to insert the soap.jar and the user have already
insert it(the path is for example c:/library/soap.jar), I have to
controlonly "soap.jar" or "c:/library/soap.jar"?
Thanks, Andrea
|
|
|
Re: How to add jar to .classpath [message #289643 is a reply to message #289142] |
Tue, 09 August 2005 14:41 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
If it is an external jar, then you need to fully-qualify it, the entire
path.
So if the user already added c:/library/soap.jar then you should not add
it again.
Andrea Sichel wrote:
> But I have to control the entirely path of the library that I would to
> insert or only the name of the library?
>
> In other words, if I have to insert the soap.jar and the user have
> already insert it(the path is for example c:/library/soap.jar), I have
> to controlonly "soap.jar" or "c:/library/soap.jar"?
>
> Thanks, Andrea
>
>
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03682 seconds