views:

73

answers:

4

I'm seeking suggestions for tools I can use on Windows to perform simple scripting and general Java development related tasks on a command line or other non-GUI interface (i.e. moving files about, starting/stopping servers, running Maven, etc.). I'm accustomed to using Cygwin which provides a virtual Linux development environment but I have just started a job which has forbidden me to use Cygwin due to security concerns. So now I need to figure out how to do what I used to do on a bash shell command line on in some other way. Should I bite the bullet and learn to use cmd and how to create batch files, or is there a better way? I know I can do lots of this sort of thing via Eclipse, and I'm looking into that already, but I'm used to doing things at a lower level since it gives me a greater sense of control and would like to stick with that approach if possible.

Thanks in advance for your comments and/or suggestions.

--James

+3  A: 

If it's basic development stuff you are trying to do, how about Ant? Beats learning DOS any day.

You could also try and learn Python and do your scripting in that.

dpb
Yes, it seems that Ant is the way forward -- at least it seems to be the lessor of the various evils I'm now having to choose from. My scripting needs are minimal so learning Python would be overkill, although it would be good to know it once I've ascended the learning slope.
James Adams
+1  A: 

Windows for a long time had the Windows Scripting Host which lets you write scripts in a variety of languages, including VB or Javascript. Google WSH or Here's a link to the technet intro tutorial. If they've disallowed Cygwin for security concerns....how do they justify using windows??? ;)

And they've probably disabled WSH as well, but it can't hurt to try.

mezmo
The security concerns about Cygwin are dubious in my opinion, and especially so, it seems, if you have your network firewalled intelligently. Unfortunately I seem to be under the thumb of a security team which uses "No!" as their favorite security measure. Good times. :)
James Adams
+1  A: 

If you already know bash, than you are already allot ahead of most Windows users. Dos batch is quite simplistic and it's not near as powerful as bash, and also, there's not that much to learn about it.

If however, you still want to reuse your Bash know-how, and Cygwin is forbidden, maybe MSys + MingGW is allowd since it's offering a similar solution under Windows but not intrusive.

If you have a good IDE (e.g. IntelliJ + ANT debug plug-in), than you can achieve many things very easily and quickly directly from ANT, leaving not much to do at the command line.

If all above are not an option for you, than a widely used option is to use quick Groovy scripting for such tasks.

I for one prefer the ANT approach since it's really platform independent, and just starting ANT tasks is similar on every platform. Also, there are visual tools for ANT like Virtual ANT that can be quite productive for complex testing scenarios.

A. Ionescu
Thanks, Ant is probably the way I'll go in the end. I'm not looking forward to the tedious XML involved, but such is life. Virtual Ant looks like a good solution for that, thanks for the link.
James Adams
If you are using a good IDE (like the one mentioned above), due to very advanced features, the work shouldn't be harder than coding in other languages. Also considering that other scripting languages don't have such a good IDE support, one could say that this way ANT has at least an edge over them (if not more). There are also many books about ANT, and writing custom tasks is a piece of cake - the only bad thing seems to be the lot hype against it :).
A. Ionescu
+1 for MSYS + MinGW (if you already know bash)
Adrian A.
+1  A: 

You can try the mighty Windows PowerShell :)

codymanix
Must resist the Dark Side.
James Adams