Skip to content

Commit 63c8d1e

Browse files
committed
Add Takipi agent mandatory JVM arguments if Java is 9+
1 parent 7e006c4 commit 63c8d1e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/java_buildpack/framework/takipi_agent.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def release
3939
.add_agentpath(agent)
4040
.add_system_property('takipi.name', application_name)
4141

42+
update_java9
43+
4244
@droplet.environment_variables
4345
.add_environment_variable('LD_LIBRARY_PATH',
4446
"$LD_LIBRARY_PATH:#{qualify_path(lib, @droplet.root)}")
@@ -99,6 +101,14 @@ def node_name
99101
"#{@configuration['node_name_prefix']}-$CF_INSTANCE_INDEX"
100102
end
101103

104+
def update_java9
105+
return unless @droplet.java_home.java_9_or_later?
106+
107+
@droplet.java_opts
108+
.add_system_property('-Xshare:off')
109+
.add_system_property('-XX:-UseTypeSpeculation')
110+
end
111+
102112
end
103113

104114
end

0 commit comments

Comments
 (0)