Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Normal
-
Resolution: Duplicate
-
Affects Version/s: 4.2.2
-
Fix Version/s: 4.3.0
-
Component/s: None
-
Labels:None
-
Environment:
Linux
Description
Hi,
When I have multiple Java versions are installed on a Linux server, it will always use the default Java and not the one specified in JAVA_HOME. The service script shoudl respect the setting from the default file and not use the default unless JAVA_HOME is not set. Because of this issue Artifactory can't be run on a host with Java 7 as the default (or the service script has to be changed).
This seems to be the related part of the Artifactory service script (misc/service/artifactory):
if type -p java; then
_java=java
elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
echo found java executable in JAVA_HOME
_java="$JAVA_HOME/bin/java"
else
echo "no java"
fi
This should be:
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
echo found java executable in JAVA_HOME
_java="$JAVA_HOME/bin/java"
elif type -p java; then
_java=java
else
echo "no java"
fi
Attachments
Issue Links
- duplicates
-
RTFACT-8529 Artifactory init.d script problem in checkJavaVersion()
-
- Resolved
-