How to change the default project directory (folder) in Netbeans 6.9?

72,904

Solution 1

I don't think you can make it module-specific but you can set it as follows:

  1. Close NetBeans
  2. Find the projectui.properties file. For me (Windows) it was under C:\Documents and Settings\Catchwa\.netbeans\6.9\config\Preferences\org\netbeans\modules\projectui.properties
  3. The projectsFolder=C:\\NetBeansProjects variable is I think what you want to change.

Solution 2

I found mine in a slightly different location (Windows 7 64-bit using Netbeans 7.2):

C:\Users\UserName\AppData\Roaming\NetBeans\7.2\config\Preferences\org\netbeans\modules\projectui.properties

Solution 3

Slightly different way of doing it for NetBeans 7.3 latest release (at least for Windows 7, 64-bit). Search your system for netbeans.conf (from explorer window) or go to its default install location:

C:\Program Files\NetBeans 7.3\etc\netbeans.conf

Look for netbeans.conf on Mac OS X:

find / -name "netbeans.conf" -print &

Look for netbeans.conf in Linux:

sudo find / -name "netbeans.conf" 2> /dev/null

Then edit the netbeans.conf file to replace the userdir line:

netbeans_default_userdir="${DEFAULT_USERDIR_ROOT}/7.3"

With your new projects directory/folder path:

 netbeans_default_userdir="C:/APPS/netbeans/"

-OR-

 netbeans_default_userdir="\Applicatons\netbeans\"

(NOTE: if you have trouble in Windows in a network managed security environment, you'll need admin access to make this change. Open the file using your editor's ".exe" directly by right-clicking the launcher file and clicking "Run as Administrator", I had to do this for Notepad++ because it said "Another application is using the file", but in fact it was just locked to non-admin users).

This changes the default userdir which stores user-specific IDE settings, but not the default project folder/directory. Next, you need to open NetBeans IDE with the new IDE settings and start to create a new Java project (then cancel after second screen in project creation wizard). It will now create a new projectui.properties file in the userdir you set; this is the file that wasn't found before this workaround that you need to edit as per the other suggestions. Mine was located here after these changes:

C:\APPS\netbeans\config\Preferences\org\netbeans\modules 

Finally, you've reached the finish line and can change the projectsFolder property value to the path you want, if you don't see a line for projectsFolder then simply type or paste one in at the bottom of the file to point to your path where you want NetBeans to store projects by default, such as:

 projectsFolder=C:/APPS/projects/

-OR-

 projectsFolder=\Applicatons\projects\

Wow, that's alot of settings changes but it finally works for me the way I wanted it to, being able to switch my IDE back and forth between a local workspace and a network workspace using my username space on the corporate LAN just by changing projectsFolder property value in the projectui.properties folder.

NOTE: On Linux or Mac you might not need the first step of modifying netbeans.conf as the projectui.properties should be as follows (may vary by OS version): $HOME/.netbeans/7.3/config/Preferences/org/netbeans/modules/projectui.properties

Solution 4

Under Windows 7, logged in under AD, the projectui.properties file's directory was under the parent folder listed in the USERPROFILE environment variable (type set in a command prompt window):

C:\Users\my_login_name\\.netbeans\7.0\config\Preferences\org\netbeans\modules\projectui.properties

It was not in the directories pointed at by the HOME or APPDATA variables.

Changed projectsFolder value to new location, restarted NetBeans and default folder for new projects was in the new location. It worked!

Solution 5

In linux/Ubuntu

  1. View hidden files in home directory (press ctrl+H on /home folder).
  2. .netbeans\7.3\config\Preferences\org\netbeans\modules\projectui.properties

Update the following content in projectui.properties file

projectsFolder=/home/folder/NB
Share:
72,904
battistis
Author by

battistis

bachelor's degree and master's degree

Updated on July 30, 2022

Comments

  • battistis
    battistis almost 2 years

    How to change the default project directory in Netbeans 6.9 for Java SE\ME\EE?

  • battistis
    battistis almost 14 years
    unfortunately I can not find that variable in my projectui.properties maybe I should create it?
  • gaborsch
    gaborsch over 11 years
    Duplication of a previous answer
  • Jason
    Jason over 11 years
    In Linux, the projectui.properties file is in $HOME/.netbeans/$VERSION/config/Preferences/org/netbeans/mod‌​ules where $VERSION is the full NB version number.
  • daiscog
    daiscog over 11 years
    Also noteworthy: if you use SVN, you can edit C:\Users\UserName\AppData\Roaming\NetBeans\7.x\config\Prefer‌​ences\org\netbeans\m‌​odules\subversion.pr‌​operties and set checkoutStep.checkoutDirectory to change the default checkout path.
  • bcmoney
    bcmoney almost 11 years
    This didn't seem to work for me, "projectui.properties" file was not at that path (at least for the latest version of Netbeans 7.3 in an enterprise/network-managed security 64-bit Windows 7 setting)... so see my workaround below if you had the same problem.
  • Lalith J.
    Lalith J. about 9 years
    Tested and working on 8.0.2 too. you do not see the C:\Users\<UserName>\AppData\Roaming\<netbeans version>\config\Preferences\org\netbeans\modules\projectui.p‌​roperties in a clean netbeans install , you have to create a one project first then the file will appear. Note** Path C:\Program Files\<netbeans version>\etc\netbeans.conf is a different file do not confuse it with C:\Users\<UserName>\AppData\Roaming\<netbeans version>\config\Preferences\org\netbeans\modules\projectui.p‌​roperties.
  • Ferrmolina
    Ferrmolina over 8 years
    Thanks this help me :)
  • Doug
    Doug over 8 years
    As a shorthand when navigating, use: %APPDATA%\Netbeans\ (etc)
  • chrips
    chrips almost 7 years
    OSX (Don't forget to change version number depending on your installed version. Mine is 8.2): /Users/username/Library/Application\ Support/NetBeans/8.2/config/Preferences/org/netbeans/modules‌​/projectui.propertie‌​s
  • jla
    jla about 6 years
    For more recent versions of windows (Vista & later) and NetBeans, look in %APPDATA%\NetBeans\<nbversion>\config\Preferences\org\netbea‌​ns\modules, eg C:\Users\jla\AppData\Roaming\NetBeans\8.1\config\Preferences‌​\org\netbeans\module‌​s
  • chrips
    chrips about 5 years
    and its incomplete
  • Nazari
    Nazari about 3 years
    Note: change netbeans_default_userdir="${DEFAULT_USERDIR_ROOT}/7.3" not recommended it will break your IDE for in case if you have version 12
  • GDP2
    GDP2 about 2 years
    Strangely for me, this didn't seem to work... I had to reinstall NetBeans and reset the default root project directory from the initial startup screen. It may have been because I was using a special build of NetBeans for a school course.
  • Catchwa
    Catchwa about 2 years
    @GDP2 or maybe because this answer is 12 years old :)