--- a/ide/launcher/netbeans.conf Thu Jan 19 13:54:28 2012 +0100 +++ a/ide/launcher/netbeans.conf Thu Jan 19 16:25:34 2012 +0100 @@ -1,5 +1,25 @@ -# ${HOME} will be replaced by JVM user.home system property -netbeans_default_userdir="${HOME}/.netbeans/dev" +# On Windows ${DEFAULT_USERDIR_ROOT} will be replaced by the launcher +# with a path to "/NetBeans" folder where is user's +# value of AppData key in Windows Registry under +# Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders +# ${DEFAULT_CACHEDIR_ROOT} will be replaced by the launcher +# with a path to "/NetBeans" folder where +# is user's value of Local AppData key in Windows Registry under +# Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders +# +# On Mac ${DEFAULT_USERDIR_ROOT} will be replaced by the launcher +# with a path to ~/Library/Application Support/NetBeans +# ${DEFAULT_CACHEDIR_ROOT} with a path to ~/Library/Caches/NetBeans +# +# On other systems ${DEFAULT_USERDIR_ROOT} will be replaced with +# a path to ~/.netbeans folder in user's home and +# ${DEFAULT_CACHEDIR_ROOT} with a path to ~/.cache/netbeans folder. +# +# NOTE: If an user specify non-default userdir so cachedir +# will be mapped to ${userdir}/var/cache. +# +netbeans_default_userdir="${DEFAULT_USERDIR_ROOT}/dev" +netbeans_default_cachedir="${DEFAULT_CACHEDIR_ROOT}/dev" # Options used by NetBeans launcher by default, can be overridden by explicit # command line switches: --- a/ide/launcher/unix/netbeans Thu Jan 19 13:54:28 2012 +0100 +++ a/ide/launcher/unix/netbeans Thu Jan 19 16:25:34 2012 +0100 @@ -59,6 +59,20 @@ progdir=`dirname "$PRG"` +case "`uname`" in + Darwin*) + # set default userdir and cachedir on MacOS + DEFAULT_USERDIR_ROOT=${HOME}/Library/Application Support/NetBeans + DEFAULT_CACHEDIR_ROOT=${HOME}/Library/Caches/NetBeans + ;; + *) + # set default userdir and cachedir on unix systems + DEFAULT_USERDIR_ROOT=${HOME}/.netbeans + DEFAULT_CACHEDIR_ROOT=${HOME}/.cache/netbeans + ;; +esac + + if [ -f "$progdir"/../etc/netbeans.conf ] ; then . "$progdir"/../etc/netbeans.conf fi @@ -68,9 +82,12 @@ # . /etc/netbeans.conf # fi +export DEFAULT_USERDIR_ROOT # #68373: look for userdir, but do not modify "$@" userdir="${netbeans_default_userdir}" +cachedir="${netbeans_default_cachedir}" + founduserdir="" for opt in "$@"; do if [ "${founduserdir}" = "yes" ]; then @@ -80,6 +97,15 @@ founduserdir="yes" fi done +foundcachedir="" +for opt in "$@"; do + if [ "${foundcachedir}" = "yes" ]; then + cachedir="$opt" + break + elif [ "$opt" = "--cachedir" ]; then + foundcachedir="yes" + fi +done if [ -f "${userdir}"/etc/netbeans.conf ] ; then . "${userdir}"/etc/netbeans.conf @@ -178,7 +204,11 @@ if [ "${founduserdir}" = "yes" ]; then exec $sh "$nbexec" "$@" else - exec $sh "$nbexec" --userdir "${userdir}" "$@" + if [ "${foundcachedir}" = "yes" ]; then + exec $sh "$nbexec" --userdir "${userdir}" "$@" + else + exec $sh "$nbexec" --userdir "${userdir}" --cachedir "${cachedir}" "$@" + fi fi } --- a/o.n.bootstrap/launcher/unix/nbexec Thu Jan 19 13:54:28 2012 +0100 +++ a/o.n.bootstrap/launcher/unix/nbexec Thu Jan 19 16:25:34 2012 +0100 @@ -480,6 +480,11 @@ jargs="-Dnetbeans.system_socks_proxy=\"$socks_proxy_tmp\" $jargs" fi +if [ ! -z "${DEFAULT_USERDIR_ROOT}" ] ; then + jargs="-Dnetbeans.default_userdir_root=\"${DEFAULT_USERDIR_ROOT}\" $jargs" + unset DEFAULT_USERDIR_ROOT +fi + # http://java.sun.com/j2se/1.5.0/docs/guide/2d/flags.html#pixmaps J2D_PIXMAPS=shared export J2D_PIXMAPS