@JAVA_HOME@/bin/java: No such file or directory error when installing Administration tools for OpenAM 11.0.0, 11.0.1 and 11.0.2
The purpose of this article is to provide assistance if you receive a @JAVA_HOME@/bin/java: No such file or directory error when installing the Administration tools (ampassword, amverifyarchive and ssoadm) for OpenAM 11.0.0, 11.0.1 and 11.0.2.
Archived
This article has been archived and is no longer maintained by ForgeRock.
Symptoms
When you install the Administration tools (SSOAdminTools-11.0.x.zip), scripts are created with the JAVA_HOME environment variable set to @JAVA_HOME@, for example:
JAVA_HOME="@JAVA_HOME@"Note
The ssoadm script checks if the JAVA_HOME environment variable is already set, and if so, uses that value instead; therefore, this issue can go unnoticed with the ssoadm script.
Errors similar to the following are shown when you attempt to use the Administration tools:
- ampassword: [user@server bin]# ./ampassword ./ampassword: line 51: @JAVA_HOME@/bin/java: No such file or directory
- amverifyarchive: [user@server bin]# ./amverifyarchive ./amverifyarchive: line 52: @JAVA_HOME@/bin/java: No such file or directory
- ssoadm: [user@server bin]# ./ssoadm ./ssoadm: line 102: @JAVA_HOME@/bin/java: No such file or directory
Recent Changes
Upgraded to OpenAM 11.0.0, 11.0.1 or 11.0.2.
Causes
The @JAVA_HOME@ variable in the scripts should be replaced with the $JAVA_HOME value specified in the respective template files (ampassword, amverifyarchive and ssoadm) when the Administration tools are installed. Instead, the @JAVA_HOME@ variable text is used to set the JAVA_HOME environment variable.
Solution
This issue can be resolved by upgrading to OpenAM 11.0.3 or later; you can download this from BackStage.
Alternatively, you can resolve it by manually changing the JAVA_HOME variable in the scripts to the correct value before using the Administration tools.
For example, in the ampassword and amverifyarchive scripts:
JAVA_HOME="/path/to/jdk"And in the ssoadm script:
if [ -z "$JAVA_HOME" ] ; then JAVA_HOME="/path/to/jdk" fiIf you want to perform an automated scripted install, you can use a command to replace the JAVA_HOME value. For example, for the ampassword script, you could use a command such as:
$ sed -i.bak -e "s/^JAVA_HOME=.*/JAVA_HOME=\/usr\/java\/latest/g" ampasswordSee Also
FAQ: Installing and using ssoadm in AM
Subsequent attempts to use ssoadm fail in AM 6.x
ssoadm create-metdata-templ command fails with NullPointerException in OpenAM 11.0.0
OpenAM Installation Guide › Installing OpenAM Tools › To Set Up Administration Tools
Related Training
N/A