TaT ConfigNetBeansUsingBatchFiles

Configure NetBeans using Batch Files..

Contributed By; Varun Nischal

Well, we all know that although editing “{netbeans.home}\etc”\netbeans.conf is not a big deal for any developer, it certainly takes a toll, if you’re using daily builds. That means, everytime you download new build of NetBeans you will modify the configuration file to tune JVM switches as per your operating system.

Here are the Tricks,

There are people who write many scripts to ease their work by automating some tasks. As I was not good at using CLI, as I am right now. So, I thought of giving it a try and I looked into the internet to learn some batch programming. After exploring for some amount of time, I have written a batch program to help me with the task and here’s what I got;

for /d }}X in (%1\NetBeans*) do edit "}}X\etc\netbeans.conf"

This batch program has got only the for-statement and this is where I look for NetBeans installation directories stored under the directory provided as a runtime argument denoted by %1 For instance, I have installed 6.7 RC1 and RC2 under C:\Program Files. So, I will make use of this batch program on CLI like this;

nbconfig "C:\Program Files"

Now, the batch program loops through this directory passed as a runtime argument and will look for the right installation directory by making use of NetBeans* as matching criteria. Once it finds the directories, it will loop each one of them, one-by-one and open the configuration file for editing.

And some tips..

That’s the benefit that you just have to pass the directory (under which such directories could be found) and Windows will automatically open the configuration file for editing, if you feel its already edited before. Just perform action (Alt-F | Exit) to exit editor and to automatically switch over to the another configuration file.

There’s a limitation that if there are 10 installation directories under one directory (passed as runtime argument) and you have already made modifications to 6 of them, you will have to pass each one of them, before you could actually make modifications to the last 4.

Referring to blog entry;

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo