如何更改netbeans设置目录的位置(〜/ .netbeans)

时间:2022-08-17 15:43:54

By default netbeans stores it's settings in a directory called .netbeans under the user's home directory. Is it possible to change the location of this directory (especially under Windows)?

默认情况下,netbeans将其设置存储在用户主目录下名为.netbeans的目录中。是否可以更改此目录的位置(尤其是在Windows下)?

Thanks to James Schek I now know the answer (change the path in netbeans.conf) but that leads me to another question: Is there a way to include the current username in the path to the netbeans setting directory?

感谢James Schek,我现在知道答案(更改netbeans.conf中的路径),但这引出了另一个问题:是否有办法将当前用户名包含在netbeans设置目录的路径中?

I want to do something like this:

我想做这样的事情:

netbeans_default_userdir="D:\etc\${USERNAME}\.netbeans\6.5beta"

but I can't figure out the name of the variable to use (if there's any). Of course I can achieve the same thing with the --userdir option, I'm just curious.

但我无法弄清楚要使用的变量的名称(如果有的话)。当然我可以用--userdir选项实现同样的目的,我只是好奇。

3 个解决方案

#1


13  

yes, edit the netbeans.conf file under %NETBEANS_HOME%\etc.

是的,编辑%NETBEANS_HOME%\ etc下的netbeans.conf文件。

Edit the line with: netbeans_default_userdir="${HOME}/.netbeans/6.0"

编辑该行:netbeans_default_userdir =“$ {HOME} /.netbeans / 6.0”

If you need different "profiles"--i.e. want to run different copies of Netbeans with different home directories, you can pass a new home directory to the launcher. Run "netbeans.exe --userdir /path/to/dir" or "nb.exe --userdir /path/to/dir"

如果你需要不同的“配置文件” - 即。想要使用不同的主目录运行不同的Netbeans副本,您可以将新的主目录传递给启动器。运行“netbeans.exe --userdir / path / to / dir”或“nb.exe --userdir / path / to / dir”

#2


2  

"HOME" is the only variable supported by the IDE. When deploying a custom application using the Netbeans Platform, "APPNAME" is also supported out of the box.

“HOME”是IDE支持的唯一变量。使用Netbeans平台部署自定义应用程序时,也支持开箱即用的“APPNAME”。

#3


2  

For someone who lands up here hunting for an answer:

对于那些在这里寻找答案的人:

If you are trying to setup a portable version in windows, Netbeans 7.2 and up wont start if userdir is at the same level or lower than the Netbeans root.

如果您尝试在Windows中设置可移植版本,如果userdir处于与Netbeans根目录相同或更低的水平,Netbeans 7.2及更高版本将无法启动。

So if you have: c:\Portable\Netbeans you can NOT do netbeans_default_userdir="c:\Portable\Netbeans\userdir\8.0"

所以如果你有:c:\ Portable \ Netbeans你不能做netbeans_default_userdir =“c:\ Portable \ Netbeans \ userdir \ 8.0”

Use a folder OUTSIDE netbeans installation e.g. netbeans_default_userdir="c:\Portable\NetbeansUserDir\8.0"

使用文件夹OUTSIDE netbeans安装,例如netbeans_default_userdir = “C:\便携式\ NetbeansUserDir \ 8.0”

for cache it does not matter.

对于缓存而言并不重要。

Tested in Windows 8.1 and 7.

在Windows 8.1和7中测试过。

#1


13  

yes, edit the netbeans.conf file under %NETBEANS_HOME%\etc.

是的,编辑%NETBEANS_HOME%\ etc下的netbeans.conf文件。

Edit the line with: netbeans_default_userdir="${HOME}/.netbeans/6.0"

编辑该行:netbeans_default_userdir =“$ {HOME} /.netbeans / 6.0”

If you need different "profiles"--i.e. want to run different copies of Netbeans with different home directories, you can pass a new home directory to the launcher. Run "netbeans.exe --userdir /path/to/dir" or "nb.exe --userdir /path/to/dir"

如果你需要不同的“配置文件” - 即。想要使用不同的主目录运行不同的Netbeans副本,您可以将新的主目录传递给启动器。运行“netbeans.exe --userdir / path / to / dir”或“nb.exe --userdir / path / to / dir”

#2


2  

"HOME" is the only variable supported by the IDE. When deploying a custom application using the Netbeans Platform, "APPNAME" is also supported out of the box.

“HOME”是IDE支持的唯一变量。使用Netbeans平台部署自定义应用程序时,也支持开箱即用的“APPNAME”。

#3


2  

For someone who lands up here hunting for an answer:

对于那些在这里寻找答案的人:

If you are trying to setup a portable version in windows, Netbeans 7.2 and up wont start if userdir is at the same level or lower than the Netbeans root.

如果您尝试在Windows中设置可移植版本,如果userdir处于与Netbeans根目录相同或更低的水平,Netbeans 7.2及更高版本将无法启动。

So if you have: c:\Portable\Netbeans you can NOT do netbeans_default_userdir="c:\Portable\Netbeans\userdir\8.0"

所以如果你有:c:\ Portable \ Netbeans你不能做netbeans_default_userdir =“c:\ Portable \ Netbeans \ userdir \ 8.0”

Use a folder OUTSIDE netbeans installation e.g. netbeans_default_userdir="c:\Portable\NetbeansUserDir\8.0"

使用文件夹OUTSIDE netbeans安装,例如netbeans_default_userdir = “C:\便携式\ NetbeansUserDir \ 8.0”

for cache it does not matter.

对于缓存而言并不重要。

Tested in Windows 8.1 and 7.

在Windows 8.1和7中测试过。