开发者

Building a J2EE dev/test setup on a single PC

It's been a while since I did Java work, and even then I was never responsible for starting a large project from the very start... there were test/staging/production systems already running, etc, etc.

Now I am looking to start a J2EE project from scratch on my trusty workstation, which has never been used for Java development and runs Windows 7 64bit.

First of all, I'll be getting Eclipse. As far as writing the code goes I'm pretty happy. And running it through Eclipse is OK, but what I'd really want is to have a VM running MySQL and TomCat on which I can properly deploy my project and run/debug it 'remotely' from my dev PC. And I guess this should be done using Ant instead of letting Eclipse build the WAR for me, so that I don't end up with a dependence on Eclipse. I'm certain Eclipse can do this, so you hit a button and it runs Ant scripts, deploys and debugs for instance, but very hazy on it.

Are there any good guides on this? I don't want to be taught Java, or even Ant, but rather the 'glue' parts like getting my test VM up and running under Windows, getting a build/test/deploy/run pipeline running through Eclipse, etc. One point, I only plan to use Windows... hosting a Windows VM on my Windwos desktop. And while I ca开发者_StackOverflow社区n use command-line tools like ant/svn, I'm much more a GUI person who loves IDE integration... I'd rather this didn't end up an argument about Linux or Vi, etc!

I am looking for free, but am a MAPS subscriber, and run Win7 Ultimate in case that makes a difference as far as free VM solutions.


I'm not sure about using a separate VM for the deployment, but I run a local SQL server and tomcat instance on my dev machine. To deploy to tomcat from eclipse is two steps for me:

  • Run an ant script that builds the contents of the war to a build directory.
  • Start tomcat from eclipse

In order to do the second part you can use the Eclipse Tomcat plugin from here This will give you nice toolbar buttons in eclipse for starting and stoping tomcat. I configure tomcat so that it loads the app directly from my build folder so there's no copying and exploding of war files involved.

A great advantage of this is that I can debug the code from eclipse at runtime.

If you've any more specific questions about this just ask.


I use NetBeans which integrates rather nicely with glassfish. Don't know about Tomcat but GF has a "hot deployment" feature. Basically you define a folder where your application is and all you have to do is copy the war/ear file there and is automatically deployed. NetBeans does this automatically and I also have integrated debugging.

I believe in Eclipse things should be easy too. From what I remember you need to define a server - like a separate project (configure the path & stuff) and it does the rest by itself.

Oh, and I also don't see the need for a VM. If it works for localhost it will work for anyhost :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜