Download NetBeans!

20090304 Wednesday March 04, 2009

Passing etc/netbeans.conf as VM Options

In situations where there is no access to etc/netbeans.conf, you can pass in those settings via VM options:

-Dnetbeans.user="/home/geertjan/foo/bar"

Then the user directory, in this case, will be created in the specified location. Now to figure out what the VM option for the installation directory is (probably -Dnetbeans.home). In case you're wondering, I'm trying to figure out how to start a NetBeans Platform application from a different IDE, which means that somehow settings such as netbeans.user need to be made available even though etc/netbeans.conf isn't.

Mar 04 2009, 11:18:14 AM PST Permalink

Trackback URL: http://blogs.sun.com/geertjan/entry/passing_etc_netbeans_conf_as
Comments:

Something wrong with --userdir?

Posted by Jesse Glick on March 04, 2009 at 11:57 AM PST #

Where would I set that if I'm deploying from Eclipse or IDEA?

Posted by Geertjan on March 04, 2009 at 01:56 PM PST #

Well best is to launch nbexec, which takes care of all these things. That is what run.xml in the standard build harness does. If you really must invoke the Java launcher directly, then you will need to reverse engineer nbexec to see what arguments it is passing.

Posted by Jesse Glick on March 04, 2009 at 02:02 PM PST #

Note that you can see what arguments it is passing by running the application from Ant (inside NetBeans or from a shell) and then looking at the output. The arguments are listed there just after "Input arguments" towards the end of the output.

Different people on our team prefer different IDEs. We develop and run platform applications under Eclipse and IntelliJ in addition to NetBeans. It's really no big deal, though as you'd guess, Eclipse and IntelliJ have no wizards for creating TopComponents, new file types and so on.

Posted by Tom Wheeler on March 04, 2009 at 02:27 PM PST #

thanks for the code. I will try to use it.

Posted by Inventory management software on March 07, 2009 at 02:51 PM PST #

Thanks for sharing. Great article.

Posted by BlackBerry malaysia on July 23, 2009 at 07:42 PM PDT #

Thanks for the code. I have been looking for it.

Posted by melayu boleh on July 23, 2009 at 07:42 PM PDT #

Wow!! I did not know you could do it that way.

Posted by Buat duit di internet on July 23, 2009 at 07:43 PM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed