I am trying to disable the CompactStrings feature of Java 9 using the VM option: -XX:-CompactStrings
, but it does not work.
When I tried to debug my application, the COMPACT_STRINGS
variable in String
class is always true (with or without the VM option)
I have the latest version of Java 9: jdk-9+181 And the Netbeans IDE Build 201709070001
I tried various options to set the VM option and none of them works.
What I tried is: setting the VM option in app.conf, setting it in project.properties, running netbeans by ./netbeans -XX:-CompactStrings, setting the JVM option in Project->Properties->Run->VM Options
Is this a bug in Netbeans? Or am I doing something wrong?
I tried to reproduce your problem using a trivial "Hello World" Java application. However, toggling the CompactStrings feature in the project properties settings worked fine for me, and caused COMPACT_STRINGS to be set appropriately, so this is not a bug in NetBeans.
Although I am using the same version of Java (181) as you, I have a more recent Dev Build of NetBeans (Build 201709220002), and there are several discrepancies between my project properties screen and yours. For example, mine shows the Runtime Platform field but yours does not:
Something else to check is that you really do have the environment you expect. I find it easy to mess things up when multiple versions of Java and Netbeans are installed.
This is what I see when I do Help -> About:
If your environment looks fine then I can only suggest that you download the latest DEV Build of NetBeans and try again.