/etc/default/openhab is the file where the, well, default values are set. You can change it, but it will be changed during update/upgrade.
But there is another file to change these values, that is /etc/openhab/linux.parameters.
I don’t know when it was introduced, but you can check whether your system is aware of that file.
Just take a look at /etc/systemd/system/multi-user.target.wants/openhab.service:
[Unit]
Description=openHAB - empowering the smart home
Documentation=https://www.openhab.org/docs/
Documentation=https://community.openhab.org
Wants=network-online.target
After=network-online.target
[Service]
Environment=OPENHAB_HOME=/usr/share/openhab
Environment=OPENHAB_CONF=/etc/openhab
Environment=OPENHAB_RUNTIME=/usr/share/openhab/runtime
Environment=OPENHAB_USERDATA=/var/lib/openhab
Environment=OPENHAB_LOGDIR=/var/log/openhab
Environment=OPENHAB_STARTMODE=daemon
EnvironmentFile=-/etc/default/openhab # openHAB default values
EnvironmentFile=-/etc/openhab/linux.parameters # values set by user
User=openhab
Group=openhab
WorkingDirectory=/usr/share/openhab
ExecStart=/usr/share/openhab/runtime/bin/karaf ${OPENHAB_STARTMODE}
ExecStop=/usr/share/openhab/runtime/bin/karaf stop
SuccessExitStatus=0 143
RestartSec=5
Restart=on-failure
TimeoutStopSec=120
LimitNOFILE=102642
[Install]
WantedBy=multi-user.target
All parameters will be read from /etc/default/openhab, then from /etc/openhab/linux.parameters.
So the latter is higher priority, but if a parameter is not set, openHAB will use the value from default.
Please be aware that EXTRA_JAVA_OPTS is one parameter, so you have to copy the definition from /etc/default/openhab to /etc/openhab/linux.parameters if there are some additional settings (afaik depends on the platform).