
|
If you were logged in you would be able to see more operations.
|
|
|
|
File Attachments:
|
|
|
Environment:
|
Windows/Unix/Linux, JDKs 1.3-1.5
|
|
| Resolution Date: |
22/Oct/05 04:16 AM
|
|
BUILDING.txt, section 3.2 states:
------------------------------------------------------------------------------------
3.2 Create property file
You will need to create a property file to specify
your environment and some of your options. Do the following
to specify your environment and options:
(1) Find out user home directory on your system. You can find
user home directory by doing echo on variable %HOME%
on windows and $home or $HOME on unix.
------------------------------------------------------------------------------------
In some cases, %HOME% (on WIndows) or $HOME ($home) (on Unix) does not correspond to the directory where ant looks for "ant.properties".
I recently tried to build Derby on Windows XP, and accidentally put ant.properties in the wrong directory, causing ant to say that java.lang could not be found. On Windows XP and 2000 (and most likely all older Windows platforms as well) "out-of-the-box", there is no environment variable called %HOME%. Creating this environment variable manually does not make any difference.
On Unix systems, the $HOME environment variable does not necessarily always correspond to ant's (i.e. Java's) interpretation of "user.home". For example, if a user changes this variable manually from "/home/username" to "/home/username/myHome", $HOME refers to the latter, but ant will continue to look for ant.properties in the "/home/username" directory.
|
|
Description
|
BUILDING.txt, section 3.2 states:
------------------------------------------------------------------------------------
3.2 Create property file
You will need to create a property file to specify
your environment and some of your options. Do the following
to specify your environment and options:
(1) Find out user home directory on your system. You can find
user home directory by doing echo on variable %HOME%
on windows and $home or $HOME on unix.
------------------------------------------------------------------------------------
In some cases, %HOME% (on WIndows) or $HOME ($home) (on Unix) does not correspond to the directory where ant looks for "ant.properties".
I recently tried to build Derby on Windows XP, and accidentally put ant.properties in the wrong directory, causing ant to say that java.lang could not be found. On Windows XP and 2000 (and most likely all older Windows platforms as well) "out-of-the-box", there is no environment variable called %HOME%. Creating this environment variable manually does not make any difference.
On Unix systems, the $HOME environment variable does not necessarily always correspond to ant's (i.e. Java's) interpretation of "user.home". For example, if a user changes this variable manually from "/home/username" to "/home/username/myHome", $HOME refers to the latter, but ant will continue to look for ant.properties in the "/home/username" directory.
|
Show » |
|
On Windows 2000 and XP, the "user.home" directory in most cases corresponds to the environment variable %USERPROFILE%, which is a concatenation of the variables %HOMEDRIVE% and %HOMEPATH%, e.g. "C:\Documents and Settings\User".
See http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx.
On Unix/Linux systems, the "user.home" directory in most cases correspond to the $HOME environment variable (e.g. "/home/username"), but this is not always true, as described above.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4787931 is a bug report that describes some issues and workarounds related to the way a variety of JVMs determines "user.home". On Windows, Java actually tries to determine the user home directory by looking in the registry for the location of the user's desktop folder, and uses that folder's parent folder as "user.home". On Unix/Linux systems, Java determines the user's home directory by looking at the user's entry in the password file, e.g. /etc/passwd.
I suggest changing BUILDING.txt, section 3.2 (1) to something like this:
----------------------------------------------------------------------------------------
(1) Determine the directory on your system that corresponds to
the "user.home" system property of the jvm referred to by
JAVA_HOME. This directory will be referred to as the
${user.home} directory in the rest of this document.
In order to correctly determine the value of ${user.home},
do either of the following:
a) Run ant diagnostics and look for "user.home" in the
list of System properties:
ant -diagnostics
b) Write and run a small java program that prints the
value of the "user.home" system property, e.g. by
including the following line in the program:
System.out.println(System.getProperty("user.home"));
On most Unix systems, ${user.home} is equivalent to the
value of the environment variable $HOME or $home.
On newer Windows systems, ${user.home} is often equivalent
to the environment variable %USERPROFILE%.
----------------------------------------------------------------------------------------
Does anyone have any comments to this suggestion?