blob: b65bf32a4c5233302c898c9d0b94beb6a18e6c4e [file] [log] [blame]
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
= DevFaqUserDir
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqUserDir
:description: Apache NetBeans wiki DevFaqUserDir
:toc: left
:toc-title:
:syntax: true
=== What is the user directory, what is in it, and why do I need one?
The userdir is a directory passed to NetBeans on startup by the launch script.
You can specify it on the command line, e.g.:
[source,java]
----
--userdir /tmp/some/folder/that/need/not/exist/yet
----
It contains configuration data that allows NetBeans to restore its state after shutdown;
it also contains log files and other miscellaneous artifacts of running NetBeans.
The `config/` subfolder of the userdir
is where changes made at runtime to the system filesystem (link:DevFaqSystemFilesystem.asciidoc[DevFaqSystemFilesystem])
are written.
Some new modules installed by Plugin Manager will also be installed here, as if it were a "cluster" directory (such as `platform` or similar in a NetBeans IDE or Platform installation). NBMs which specify a particular cluster name will not be placed in the user directory, however.
It is expected that applications built on the NetBeans platform
will provide a custom launch script which will specify the userdir
such that it does not overlap with any other platform-based application.
This is done for you if you use the stock launchers created by "suite" projects in the IDE.
Only one running copy of NetBeans may use a single userdir at a time;
during startup, the platform checks a lock file and if it is present,
tries to contact the running instance via a socket,
to determine if the lock file is stale or not.
If it does not make contact, it will display a warning
and ask the user if startup should continue.
This same protocol also supports link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-sendopts/overview-summary.html[command-line options].
You can find the path to the userdir at runtime if you need to,
using the system property `netbeans.user`.
Most modules should not do this;
use `Places.getUserDirectory` to find the userdir or use `FileUtil.getConfigFile`
to work with the `config/` subdirectory.
<hr/>
Applies to: NetBeans 6.7 and later
=== Apache Migration Information
The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.
This page was exported from link:http://wiki.netbeans.org/DevFaqUserDir[http://wiki.netbeans.org/DevFaqUserDir] ,
that was last modified by NetBeans user Frederic.deniger
on 2012-11-01T17:21:20Z.
*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.