Skip to content


Restriction: This system property is supported only on Java™ 8. String sharing cannot be enabled on Java 11 and later.

Start of content that applies only to Java 8 (LTS) Setting this property to true avoids sharing a String object when substring() is used to subset a String beginning from offset zero. Avoiding sharing is compatible with the Oracle HotSpot VM.


Setting Effect Default
true No sharing
false Sharing yes