I’m using the CommandBox embeded server and config...
# box-products
e
I’m using the CommandBox embeded server and configured it to use Adobe coldfusion as de Engine “cfengine”:“adobe@11", DOes anybody know how to add some “JVM Arguments” similar to the ones found under Coldfusion administrator “Java and JVM”?
cooreccion “Commandbox embeded server”
s
ok, there are 3 ways, but the simplest is to set them in your server.json
Copy code
"jvm": {
        "heapSize": 512,
        "minHeapSize": 256,
        "args": "",
        "javaHome" : "/path/to/java/home",
        "javaVersion" : "openjdk11"
    },
you would add them in the
args
key
and i should mention the args can be a string or an array like so
Copy code
"jvm" : {
    "args" : [
       "-XX:+UseG1GC",
       "-XX:-CreateMinidumpOnCrash",
       "--add-opens=java.base/java.net=ALL-UNNAMED"
    ]
  },
d
So those don’t come over when you export settings via cfconfig, it looks like. Is that right?
s
i would need to summon @bdw429s to answer that question. With commandbox I have always used server.json to configure the jvm, but i do remember if CFAdmin there was a place to do so as well
👍 1
d
It’s there in the cfadmin for sure, but I don’t see it in the cfconfig file that gets exported. Just curious if I was missing something. The way above works great too.
b
@danmurphy CFConfig doesn't does the values set in the "Java and JVM" page of the CF admin for the same reason that page doesn't appear on a J2E installation 🙂
Those settings aren't part of the CF XML files, but instead part of a file only used by CF's proprietary hacked-up Tomcat version
They are JRE/servlet settings and need to be handled by the bootstrap that actually starts java, not CF proper.