From b65e37019c04b2f93661cb7b0b6a27efd36b5627 Mon Sep 17 00:00:00 2001 From: Elisabeth Panholzer Date: Mon, 4 Aug 2025 13:10:56 +0200 Subject: [PATCH] Add new cheerpjInit option to cj docs --- .../docs/12-reference/00-cheerpjInit.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sites/cheerpj/src/content/docs/12-reference/00-cheerpjInit.md b/sites/cheerpj/src/content/docs/12-reference/00-cheerpjInit.md index 6cb74398..8b454b23 100644 --- a/sites/cheerpj/src/content/docs/12-reference/00-cheerpjInit.md +++ b/sites/cheerpj/src/content/docs/12-reference/00-cheerpjInit.md @@ -28,6 +28,7 @@ async function cheerpjInit(options?: { licenseKey?: string; execCallback?: (cmdPath: string, argsArray: string[]) => void; enableDebug?: boolean; + hostName?: string; }): Promise; ``` @@ -428,6 +429,23 @@ cheerpjInit({ enableDebug: true }); Learn more about how to debug CheerpJ in our [Debugging CheerpJ guide](/docs/guides/cheerpj-debug). +### `hostName` + +```ts +hostName?: string; +``` + +> [!note] Important +> The `hostName` option is supported in CheerpJ 3.1 and later versions. + +This option will set the hostname of the JVM to the string passed as an argument. This is the value returned when calling the standard Java functions `getHostName()` or `getHostAddress()` from the `java.net.InetAddress` package. These functions are used, for instance, by Oracle's WebUtil component. + +Example of usage: + +```js +cheerpjInit({ hostName: "10.10.90.200" }); +``` + [cjGetRuntimeResources]: /docs/reference/cjGetRuntimeResources [Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise [`java`]: /docs/reference/cheerpjInit#java-mode