By user12611203 on Apr 28, 2008
I was recently setting up a couple new machines and went through my normal process:
- Install a new browser or two.
- Install Java if there isn't a version I want already.
- Install NetBeans.
Need ant? It's already in NetBeans -- add the ant/bin directory in your NetBeans installation to your path (a good idea so you don't run into version mismatches between command line and IDE). Need cvs? There's already a nice cvs GUI in the IDE. So I'm ready for development, or so I thought.
A project I was working on, as part of the build process, used ant to check out a couple other workspaces under cvs. This failed since ant was expecting cvs to exist in my path. Oops. Ok, I could go download one of the many cvs clients, or on a Mac installation install the large developer bundle. But there's already some form of cvs inside NetBeans, so why can't I use that? No point duplicating bits on my hard drive.
Well, you can use the cvs client inside NetBeans from the command line. There is no executable cvs(.sh, .bat) script, but there's a cvs client jar file that will do the trick: org-netbeans-lib-cvsclient.jar
You can find it easily enough but here are the locations in NB 6.X:
- 6.0: <netbeans>/ide8/modules/org-netbeans-lib-cvsclient.jar
- 6.1: <netbeans>/ide9/modules/org-netbeans-lib-cvsclient.jar
So I just create a little script called "cvs" (or cvs.bat) to call the jar file. Here's the one I'm using on a Mac, with the full path left out for readability:
java -jar <path>/org-netbeans-lib-cvsclient.jar "$@"
hostname:~ bobby$ cvs -version Java Concurrent Versions System (JavaCVS) 1.9 (client)
That's all there is to it. With this simple cvs script, I can now run all the command line cvs I want and use the GUI to handle the heavy lifting (ok, the heavy, the medium, and most of the light lifting).