diff --git a/lib/java_buildpack/jre/open_jdk_like_jre.rb b/lib/java_buildpack/jre/open_jdk_like_jre.rb index 8602eea9e1..e42e8cc613 100644 --- a/lib/java_buildpack/jre/open_jdk_like_jre.rb +++ b/lib/java_buildpack/jre/open_jdk_like_jre.rb @@ -64,9 +64,8 @@ def compile def release @droplet .java_opts + .add_option('-XX:ActiveProcessorCount', '$(nproc)') .add_system_property('java.io.tmpdir', '$TMPDIR') - - set_active_processor_count unless @droplet.java_home.java_10_or_later? end private @@ -88,10 +87,6 @@ def link_local_dns? end end - def set_active_processor_count - @droplet.java_opts.add_option '-XX:ActiveProcessorCount', '$(nproc)' - end - end end diff --git a/spec/java_buildpack/jre/open_jdk_like_jre_spec.rb b/spec/java_buildpack/jre/open_jdk_like_jre_spec.rb index ddec80e3ec..1d2cbe1af3 100644 --- a/spec/java_buildpack/jre/open_jdk_like_jre_spec.rb +++ b/spec/java_buildpack/jre/open_jdk_like_jre_spec.rb @@ -75,22 +75,12 @@ expect(networking.networkaddress_cache_negative_ttl).to eq 0 end - it 'sets active processor count before Java 10', + it 'sets active processor count', cache_fixture: 'stub-java.tar.gz' do - java_home.version = JavaBuildpack::Util::TokenizedVersion.new('1.8.0_162') - component.release expect(java_opts).to include('-XX:ActiveProcessorCount=$(nproc)') end - it 'does not set active processor count from Java 10 and later', - cache_fixture: 'stub-java.tar.gz' do - - java_home.version = JavaBuildpack::Util::TokenizedVersion.new('10.0.1_10') - - expect(java_opts).not_to include('-XX:ActiveProcessorCount=$(nproc)') - end - end