Use --jre-headless instead of --jre

In some cases it can cause problems and report these kind of errors:

$ update-java-alternatives -s /usr/lib/jvm/java-1.7.0-openjdk-amd64 --jre
update-alternatives: error: no alternatives for policytool
update-alternatives: error: no alternatives for policytool
This commit is contained in:
Richard Pijnenburg
2015-01-07 21:53:07 +00:00
parent 55ca769bc2
commit 3b290abddf
3 changed files with 20 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ class java::config ( ) {
if $java::use_java_alternative != undef and $java::use_java_alternative_path != undef {
exec { 'update-java-alternatives':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => "update-java-alternatives --set ${java::use_java_alternative} --jre",
command => "update-java-alternatives --set ${java::use_java_alternative} ${java::jre_flag}",
unless => "test /etc/alternatives/java -ef '${java::use_java_alternative_path}'",
}
}