Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Ant "Contributed Entries" not available when I run the task
Ant "Contributed Entries" not available when I run the task [message #754774] Fri, 04 November 2011 09:56 Go to next message
Byron Hawkins is currently offline Byron HawkinsFriend
Messages: 4
Registered: October 2011
Junior Member
I'm trying to use an ant task that appears in "Preferences > Ant > Runtime > Classpath > Contributed Entries". Auto-completion is available in the build.xml file editor, but when I run the ant task it says:

D:\workspace\explore\rns-assembler\build.xml:65: Problem: failed to create task or type p2.director

When I look in the run profile, I can see that the classpath is missing the jar for this task. It is only in my "Contributed Entries", not also in the run profile. So... I can't have it on the runtime classpath?

I have two questions:

1. Why are all the "Contributed Entries" missing from the run profile?
2. When I add the jar as an "external jar", it still doesn't work. Why not?

Thanks for your help.


Byron

[Updated on: Sat, 05 November 2011 13:15]

Report message to a moderator

Re: Ant "Contributed Entries" not available when I run the task [message #755785 is a reply to message #754774] Wed, 09 November 2011 15:19 Go to previous messageGo to next message
Michael Rennie is currently offline Michael RennieFriend
Messages: 67
Registered: July 2009
Location: Canada
Member
In your launch configuration for the buildfile, what is the JRE set to? If you set it to be 'Run in the same VM as Eclipse' it will work as expected.

> 1. Why are all the "Contributed Entries" missing from the run profile?

They are not, but depending on your JRE setting you might have to do more work setting up the classpath so the tasks will run.

Let me try to explain (as best I can): when you run in the same JRE as Eclipse the classpath Ant uses already contains all of the jars / libs / bundles that Eclipse is using, so in essence you get your classpath for 'free' (and the tasks work). However, when you set your configuration to run in a separate JRE you are mimicking how Ant would run if you ran it from the command line - i.e. you have to compose the environment + classpath as needed in the launch configuration.

> 2. When I add the jar as an "external jar", it still doesn't work. Why not?

As I found out, the p2 Ant tasks do not run outside of an OSGi environment anyways. See http://stackoverflow.com/questions/2327393/running-p2-ant-tasks-outside-eclipse for better answers to your p2 Ant task questions
Re: Ant "Contributed Entries" not available when I run the task [message #755856 is a reply to message #755785] Wed, 09 November 2011 20:13 Go to previous message
Byron Hawkins is currently offline Byron HawkinsFriend
Messages: 4
Registered: October 2011
Junior Member
I tried running in the same JRE as Eclipse, but that didn't work either. Thanks for the SO post, that is actually one that I saw earlier but I missed the point about the OSGi environment. Looks like the P2 tasks simply can't be run in any normal ant environment, so I'll have to set up the AntRunner launch. If only that were a little simpler to do... Smile

Byron
Previous Topic:(to delete)
Next Topic:Error related to generic type declaration
Goto Forum:
  


Current Time: Thu Mar 28 14:54:21 GMT 2024

Powered by FUDForum. Page generated in 0.02117 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top