- This topic has 3 replies, 2 voices, and was last updated 16 years, 3 months ago by
Riyad Kalla.
-
AuthorPosts
-
I’m finding that most projects I work on don’t use MyEclipse for development. I always then have the issue of trying to get them to work in MyEclipse.
So, as a test, I started a fresh test project working through the Spring tutorial at:
http://static.springframework.org/docs/Spring-MVC-step-by-step/part1.html
The problem I’m having with this tutorial is that the Ant build script can’t find the Spring libraries that get imported into the MyEclipse Web Project (when you “Add MyEcipse Capabilities” from the MyEclipse menu) and I can’t figure out how to set the classpath correctly in the Ant script so it will work.
So, my basic question is … when building a web app, should I opt to basically just use MyEclipse (so it can find everything and actually work) or forget MyEclipse’s built-in capabilities and just use Ant?
It seems so far that the two approaches are somewhat incompatible.
As another example of this disconnect between MyEclipse and the Ant approach, when I type in a simple Controller (Spring), there are no compile errors, but when running the Ant build task, I get “Cannot find symbol” on the
“return new ModelAndView(“hello.jsp”);” line of code (as well as others).
Again, this may be simple classpath problem that’s not right in the Ant script.
Look forward to any advice or suggestions.
Thanks.
— M
Riyad KallaMemberMork,
You identified the problem — the libraries that MyEclipse adds to your build path are our own Classpath Containers — Ant has no knowledge of how to use these (or that they exist) so in Ant’s world, you effectively have an empty classpath.
As far as using Ant or MyEclipse — it depends on what you are trying to do. The easiest thing is just to use MyEclipse, but if you need to share with 100 other people that use everything from textpad to RAD, then sure… you can use Ant. You might even want to give Maven a try.
It’s just up to you.
Thanks for your reply.
It’s just a little frustrating since all the examples on the Web seem to use Ant tasks.
As soon as I entered the Jars separately (and in addition) from the MyEclipse jar files, the Ant task worked fine.
The really confusing thing is that the MyEcipse IDE can find all the references in the code (in its containers, as you pointed out), but Ant is still blissfully unaware.
I’d much prefer to just use MyEclipse, but it’s never been the case, except for one project 5 years ago, where anyone has used it for a project from scratch.
Thanks very much for your reply….I suppose for the tutorial, I should stick to Ant to minimize the impact of playing around with Spring MVC.
Thanks as always R.
– M
Riyad KallaMemberNo problem Mork.
-
AuthorPosts