From caf3c92515cb11b2fd21a031f7021ee77ad92db0 Mon Sep 17 00:00:00 2001 From: Ana Gabriela Reyna Date: Thu, 19 Oct 2023 17:46:42 +0100 Subject: [PATCH 1/9] edits on applet quickstart --- .../03-getting-started/01-Java-applet.mdx | 33 +++++++++++++---- .../10-getting-started/01-Java-applet.mdx | 35 ++++++++++++++----- 2 files changed, 53 insertions(+), 15 deletions(-) diff --git a/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx b/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx index 30416a8c..82aa5fb8 100644 --- a/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx +++ b/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx @@ -16,12 +16,32 @@ CheerpJ can run Java applets in the browser seamlessly. This page will help you **You will need:** - Your applet file(s) -- An HTML file to wrap your applet +- The HTML file where your applet is meant to be displayed. - A basic HTTP server to test locally -### 1. Create a basic HTML file +### 1. Integrating CheerpJ in your HTML file -```html title="index.html" {6-9,12-19} +This example assumes you already have your own HTML file displaying your applet using ``, `` or ``. + +In order to integrate CheerpJ, you just need to add: + +1. A simple ` +``` + +2. A second script calling `cheerpjInit()` + +```html + +``` + +For example: + +```html title="index.html" {6-9} @@ -33,14 +53,14 @@ CheerpJ can run Java applets in the browser seamlessly. This page will help you -

not able to load Java applet

-
+ ``` @@ -56,8 +76,7 @@ http-server -p 8080 ### What's going on? -- The `cheerpjInit({enablePreciseAppletArchives:true});` initializes CheerpJ runtime environment indicating we are loading an applet. -- The `` tag specifies the code base in a similar manner as the now deprecated `` tag. +- The `cheerpjInit({enablePreciseAppletArchives:true})` initializes CheerpJ runtime environment indicating we are loading an applet. > To avoid potential conflicts with native Java we recommend replacing the original HTML tag with `cheerpj-` prefixed version. You should use ``, `` or `` depending on the original tag. diff --git a/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx b/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx index 4d7e26ef..659d2551 100644 --- a/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx +++ b/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx @@ -8,7 +8,7 @@ CheerpJ can run Java applets in the browser seamlessly. This page will help you **There are two different ways to run a Java Applet in the browser:** -- [Running your own Java applet](/cheerpj3/getting-started/Java-applet#running-your-own-applet) using the CheerpJ runtime environment and the `` tag in your own webpage. +- [Running your own Java applet](/cheerpj3/getting-started/Java-applet#running-your-own-applet) using the CheerpJ runtime environment in your own webpage. - [Running a public applet](/cheerpj3/getting-started/Java-applet#running-a-public-applet) using the [CheerpJ Applet Runner](https://chrome.google.com/webstore/detail/cheerpj-applet-runner/bbmolahhldcbngedljfadjlognfaaein) Chrome extension for applets integrated with the applet tag `` on public websites. ## Running your own applet @@ -16,12 +16,32 @@ CheerpJ can run Java applets in the browser seamlessly. This page will help you **You will need:** - Your applet file(s) -- An HTML file to wrap your applet +- The HTML file where your applet is meant to be displayed. - A basic HTTP server to test locally -### 1. Create a basic HTML file +### 1. Integrating CheerpJ in your HTML file -```html title="index.html" {6, 9-17} +This example assumes you already have your own HTML file displaying your applet using ``, `` or ``. + +In order to integrate CheerpJ, you just need to add: + +1. A simple ` +``` + +2. A second script calling `cheerpjInit()` + +```html + +``` + +For example: + +```html title="index.html" {6, 15-17} @@ -30,14 +50,14 @@ CheerpJ can run Java applets in the browser seamlessly. This page will help you - + > @@ -55,7 +75,6 @@ http-server -p 8080 ### What's going on? - The `cheerpjInit();` initializes CheerpJ runtime environment. -- The `` tag specifies the code base in a similar manner as the now deprecated `` tag. > To avoid potential conflicts with native Java we recommend replacing the original HTML tag with `cheerpj-` prefixed version. You should use ``, `` or `` depending on the original tag. From 1ba589b8af7529a72fb5b172b61bcfb7d67f050b Mon Sep 17 00:00:00 2001 From: Ana Gabriela Reyna Date: Thu, 19 Oct 2023 17:50:24 +0100 Subject: [PATCH 2/9] updated applet template zip file --- public/cheerpj3/examples/applet-template.zip | Bin 84824 -> 85136 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/cheerpj3/examples/applet-template.zip b/public/cheerpj3/examples/applet-template.zip index 9db767a97dfbcf4c62862652f29066e10def0b1b..14faa0d32f0f4764296e365e2e9f8e50287a06cb 100644 GIT binary patch delta 1249 zcmcaHjdj9I)(MlD1>+1S|K-%$c)*W^SFtZRoB;|dCrh)c)&Gk%Ooidn3T_5QmamKq z3@jo*MWrEU^KKjP?0c>m5qnK8NtKt2XJxX&-G#po8ziuH$)?WS8ggTj;>E(IME)(; zZ%pp}=ecX!?Sm5>gXHb&RHn`ojk~cu67PO$3 zOE6P8s;Yj*eo+N>@yJyMzq3501AK!O5B{`nmYCHqzEWmyZOoN}W-Nv;dJSBBW4u?& zGh5CLSuv+nb)i}3x2-X%-3z9_i4Bbtm6&u~V^c^Uhfhe~o=YC>f_pYt|2U}bu=d;M zb7Cpi3bsa={C<5>%Io#D1yP?Cw-)#phu)mDR!TPU#asKI^~R@#L+Uf0pLn*_mfA-4SnJShH*fZ+Ot=GusyX?Fcvh?~s1-z!FLE?Q@v?!+*r{ z-#h+u$p)@lH)QjUEckscY5EJVqZ$ssAH}CNZ!@{G>uQo>f`Q?6(3Z2fENRYT{=TAqBqMD5zA^Npav9u@av1gNv_WM&D zPug?hx82{Cue9Wq%XyZX3aL5kUQaT5ab)F+NtfO~`TKY8ACvevuTACA`G7B#}_4sn-?BieG-XC?lvM)n>PMdpa zm*|`yH3ieo>91>F?f=^<&vE~bzuuqO1H3iaIoc#%%#CAWV5nqaUqmS%Kys(h?m^eTs^X0csw{nH0nv zf)8~FO!qo>{;Ic*#tF}>r#*G_Gr})JIC>~ z*$gp2D>pD~zQnG<1j<0oe>u1RQKjhW%aR2}S delta 1064 zcmbO*ll8_l)(MlDlQT6Z%W`OKJmAM7xVFYOoB;|NSr{0kCL0P1Pw#hO(in%i`}Q6=#+Q$nKmt3<&*BY-9a;VWA6pGmp#fF zpG(*#gm?%|nP#VuySS}h?peN)z+W**EyKS_9+?wLW0em6jP8B$nqRzAqHOn`1$$O< zHih5z5WbqI+*0)=B{XKymSbWqUdK;`Ce`kbT6696(W27*QG1`QDSesJXIIA)IIDxP zleOD1Ug(9zgePhI_bXXfJW0GaYt9!oJ@M{e1*UGbiEr3aobx&aw^nI7OH-U z{li{gRoV24@2s)=lU00q4zG*#=0BgX+I)kR>V_+hH+4?N)V;|~=*+BFxp=z7{6{N$ zf>~1YqE3bfv$Jhd?rmkX)yS-0t9;?ovo-xDeyVDbb9`qVDGpqm_3^l`zWR^b z>MaXmvkykNnLbQ$Y+Jh7m7&P?_Vc^f@2+O(v^jZMPJW)$irm{fK4@(-I)E+PU^XONa`U&MOFR6L+rJdi;;<34=CsFk8hTze~mXlTInkS1J zY|qaz=Wtfu^B_6&;n6ic_tr1|a>b%%?wcR==l{8NT#C21=QZ5%bV2D-ZJuxYe4PBR z&N;TD+I(B!(@)EeY^+StzIib4e0BDVKaW<~|1w#BSWKj(`SxCm{fq(L>>OgODGM@~ z7#JE^Cg*WUY+lbHzywRi&2PB2zu{uMZUGXQ?&!iOGyRb>V>K@*Wy7^i&vIcj;fAGV zAPrGy;mRn-bcKC-gezkz(`wG?`&}805yl9*0cC@@rW?937BN}#f@r15c6?gX7kD#r zO#cbwG5ryoe$j(ba=Mv2qZd=45J-vi^ttYg0Zfy{roVRwnrbKk);GPvgE5@RQwF3w zo9V7Kh?bci<;m#JbUzx*nS3Wk6=X8c^dFu;dkbnIqPcZY(Nr&>=-hb_(OL7sq5{*e zc`-^c%1;02#hAmC^#EdOwKtSkr>|#ZgesNwVU%KyQiKSHD>15y1$eWv Tf%3j65Ps)iVDNSVW^e`oUAnKz From 3cf17a1d53b4d03c11c39f54f8ee49344f84d8d1 Mon Sep 17 00:00:00 2001 From: Ana Gabriela Reyna Date: Thu, 19 Oct 2023 18:07:17 +0100 Subject: [PATCH 3/9] Apply suggestions from code review Co-authored-by: Alex Bates --- .../docs/cheerpj2/03-getting-started/01-Java-applet.mdx | 5 +++-- .../docs/cheerpj3/10-getting-started/01-Java-applet.mdx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx b/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx index 82aa5fb8..d50e4cf9 100644 --- a/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx +++ b/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx @@ -21,7 +21,7 @@ CheerpJ can run Java applets in the browser seamlessly. This page will help you ### 1. Integrating CheerpJ in your HTML file -This example assumes you already have your own HTML file displaying your applet using ``, `` or ``. +This tutorial assumes you already have an HTML file with an ``, `` or `` tag. In order to integrate CheerpJ, you just need to add: @@ -78,7 +78,8 @@ http-server -p 8080 - The `cheerpjInit({enablePreciseAppletArchives:true})` initializes CheerpJ runtime environment indicating we are loading an applet. -> To avoid potential conflicts with native Java we recommend replacing the original HTML tag with `cheerpj-` prefixed version. You should use ``, `` or `` depending on the original tag. +> [!tip] Avoiding conflicts with native Java plugins +> In case your users have a native Java plugin installed, you can replace the original HTML tag with a `cheerpj-` prefixed version. ``, `, and `` are all supported. ## Running a public applet diff --git a/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx b/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx index 659d2551..27bcfbfe 100644 --- a/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx +++ b/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx @@ -35,7 +35,7 @@ In order to integrate CheerpJ, you just need to add: ```html ``` From 91b2352ee66abec09a2ad7026dd1f68e061975cf Mon Sep 17 00:00:00 2001 From: Ana Gabriela Reyna Date: Fri, 20 Oct 2023 12:29:57 +0100 Subject: [PATCH 4/9] applied feedback changes --- .../03-getting-started/01-Java-applet.mdx | 10 ++++------ .../10-getting-started/01-Java-applet.mdx | 15 +++++++-------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx b/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx index d50e4cf9..69bd3441 100644 --- a/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx +++ b/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx @@ -31,7 +31,7 @@ In order to integrate CheerpJ, you just need to add: ``` -2. A second script calling `cheerpjInit()` +2. A second script calling [`cheerpjInit({enablePreciseAppletArchives:true})`] to initialize CheerpJ's runtime environment. ```html ``` -2. A second script calling `cheerpjInit()` +2. A second script calling [`cheerpjInit()`] to initialize CheerpJ's runtime environment. ```html @@ -72,11 +72,8 @@ npm install http-server http-server -p 8080 ``` -### What's going on? - -- The `cheerpjInit();` initializes CheerpJ runtime environment. - -> To avoid potential conflicts with native Java we recommend replacing the original HTML tag with `cheerpj-` prefixed version. You should use ``, `` or `` depending on the original tag. +> [!tip] Avoiding conflicts with native Java plugins +> In case your users have a native Java plugin installed, you can replace the original HTML tag with a `cheerpj-` prefixed version. ``, ``, and `` are all supported. ## Running a public applet @@ -114,3 +111,5 @@ You will see the CheerpJ display on your browser with some loading messages befo ## Further reading - [Runtime API reference](/cheerpj3/reference) + +[`cheerpjInit()`]: /cheerpj3/reference/cheerpjInit From b0a7b42dba65b17f96c24dbe8725b2594fd476bc Mon Sep 17 00:00:00 2001 From: Ana Gabriela Reyna Date: Fri, 20 Oct 2023 12:40:09 +0100 Subject: [PATCH 5/9] removed callout --- src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx | 1 - src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx | 1 - 2 files changed, 2 deletions(-) diff --git a/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx b/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx index 69bd3441..c09630ed 100644 --- a/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx +++ b/src/content/docs/cheerpj2/03-getting-started/01-Java-applet.mdx @@ -74,7 +74,6 @@ npm install http-server http-server -p 8080 ``` -> [!tip] Avoiding conflicts with native Java plugins > In case your users have a native Java plugin installed, you can replace the original HTML tag with a `cheerpj-` prefixed version. ``, ``, and `` are all supported. ## Running a public applet diff --git a/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx b/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx index 0420d69e..e52ff02e 100644 --- a/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx +++ b/src/content/docs/cheerpj3/10-getting-started/01-Java-applet.mdx @@ -72,7 +72,6 @@ npm install http-server http-server -p 8080 ``` -> [!tip] Avoiding conflicts with native Java plugins > In case your users have a native Java plugin installed, you can replace the original HTML tag with a `cheerpj-` prefixed version. ``, ``, and `` are all supported. ## Running a public applet From 288d22225fc21acfb6f4127ddccaa6a38fd4a439 Mon Sep 17 00:00:00 2001 From: Ana Gabriela Reyna Date: Fri, 20 Oct 2023 23:02:33 +0100 Subject: [PATCH 6/9] JNLP quickstart --- .../cheerpj3/10-getting-started/03-JNLP.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 src/content/docs/cheerpj3/10-getting-started/03-JNLP.md diff --git a/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md b/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md new file mode 100644 index 00000000..b303c391 --- /dev/null +++ b/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md @@ -0,0 +1,130 @@ +--- +title: Run a JNLP +description: Run a JNLP application in the browser (setup) +--- + +This quickstart tutorial will take you step by step on the things you need to setup before running your JNLP app in the browser with CheerpJ. + +You will need: + +- The application `.jnlp` file. + +## 1. The `.jnlp` file + +The `.jnlp` file contains the specifics of how to launch your Java application. The usual pipeline starts when this file is triggered from a website so it is passed to the user's local JNLP client which downloads the application `.jar` files and further resources. Finally, the app is executed with the local JRE installation. **With CheerpJ it is possible to run this application in the browser sandbox, no Java installation required.** + +Your `.jnlp` file might look something like the example below. There are two essential elements you need to find: + +1. The `.jar` files specified under the `` element, usually indicated with a `` or `` tags. +2. Your application type. Seek for ` ` or `` tag. +3. You may need the `codebase` URL at `` + +```xml title="example.jnlp" {5, 22-23, 26} + + + + + Your application name + Vendor name + + Description of your Java application + Another description of your Java application + + + + + + + + + + + + + + + +``` + +## 2. Create a project directory + +Once you have identified where the `` or `` tags are in your JNLP, you can simply download these JARs by copying and pasting their URLs in the browser's navigation bar. If these URLs are relative then build the full URL by appending the `codebase` URL and the `jar` URL: + +For example: + +``` +code-base-url/my_application_archive.jar +code-base-url/lib/my_dependency.jar +``` + +Please create a directory for your project and place the JARs you just downloaded inside this folder, remember to keep the same directory structure as shown in your `.jnlp`. + +For example: + +```shell +mkdir -p directory_name/lib +``` + +Once you moved the JARs it should look like this: + +``` +└── directory_name + ├── my_application_archive.jar + └── lib + ├── my_dependency.jar +``` + +## 3. Identify your application type + +A JNLP app can be a **standalone application** or an **applet**. This is easy to spot on your `.jnlp` file with the tags **``** or **``** correspondingly. The following steps for each type of app are described below. + +### If your application is a standalone app + +Before jumping to the next steps, take a close look at content of `` and keep the following at hand: + +- **The application class name:** You can find it at the `main-class` attribute. This attribute may not be there if the class name is included in the manifest. +- **The application arguments:** If any arguments are required, you will find these with the `` tag. + +> [!note] Note +> If you do not find any of the elements listed above, this means you do not need them to run your application. + +Now you have everything you need until this point to run your JNLP app as a standalone application. Please continue to our [run a Java application] tutorial to run it in the browser with CheerpJ. + +### If your application is an applet + +Take a close look to the `` tag on your `.jnlp` and keep the following at hand: + +- **Any applet tag parameters:** + + - **The applet class name:** You can find it at the main-class attribute. + - **The applet ideal size:** defined at `width` and `height` attributes. + - **Applet parameters:** found as `` within `` if your applet requires it. + +- **documentBase:** If you retrieve this URL, you will obtain an HTML file where the applet is wrapped. You can use it or create your own HTML file like [this one](/cheerpj3/getting-started/Java-applet#1-integrating-cheerpj-in-your-html-file). + +Now you have everything you need until this point to run your JNLP app as an applet. Please continue to our [run a Java applet] tutorial to run it in the browser with CheerpJ. + +## The end + +You are done setting up what you needed from your JNLP file. Now you can continue with the appropriate tutorial to run your app in the browser with CheerpJ. + + + +[run a Java application]: /cheerpj3/getting-started/Java-app +[run a Java applet]: /cheerpj3/getting-started/Java-applet From 7442f14b28c2a6c9af496a0c617f5977f2b4e8e4 Mon Sep 17 00:00:00 2001 From: Ana Gabriela Reyna Date: Wed, 25 Oct 2023 13:11:38 +0100 Subject: [PATCH 7/9] JNLP quickstart suggestions applied --- .../cheerpj3/10-getting-started/03-JNLP.md | 133 +++++++++++++++--- 1 file changed, 115 insertions(+), 18 deletions(-) diff --git a/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md b/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md index b303c391..dc149450 100644 --- a/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md +++ b/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md @@ -1,23 +1,25 @@ --- title: Run a JNLP -description: Run a JNLP application in the browser (setup) +description: Run a JWS/JNLP application in the browser --- -This quickstart tutorial will take you step by step on the things you need to setup before running your JNLP app in the browser with CheerpJ. +This quickstart tutorial will take you step by step on how to run your JNLP app (also known as Java Web Start application) in the browser with CheerpJ. You will need: - The application `.jnlp` file. +- An HTML file where your Java app will be wrapped. +- A simple HTTP server to test your webpage locally. ## 1. The `.jnlp` file The `.jnlp` file contains the specifics of how to launch your Java application. The usual pipeline starts when this file is triggered from a website so it is passed to the user's local JNLP client which downloads the application `.jar` files and further resources. Finally, the app is executed with the local JRE installation. **With CheerpJ it is possible to run this application in the browser sandbox, no Java installation required.** -Your `.jnlp` file might look something like the example below. There are two essential elements you need to find: +Your `.jnlp` file might look something like the example below. There are three essential elements you need to find: 1. The `.jar` files specified under the `` element, usually indicated with a `` or `` tags. 2. Your application type. Seek for ` ` or `` tag. -3. You may need the `codebase` URL at `` +3. You may need the `codebase` URL at ``. ```xml title="example.jnlp" {5, 22-23, 26} @@ -27,11 +29,11 @@ Your `.jnlp` file might look something like the example below. There are two ess codebase="code-base-url" href="example.jnlp"> - Your application name + Your application name Vendor name Description of your Java application - Another description of your Java application + Another description of your Java application @@ -40,10 +42,10 @@ Your `.jnlp` file might look something like the example below. There are two ess - + - + @@ -74,16 +76,20 @@ Once you moved the JARs it should look like this: └── directory_name ├── my_application_archive.jar └── lib - ├── my_dependency.jar + └── my_dependency.jar ``` -## 3. Identify your application type +## 3. Create a basic HTML file -A JNLP app can be a **standalone application** or an **applet**. This is easy to spot on your `.jnlp` file with the tags **``** or **``** correspondingly. The following steps for each type of app are described below. +### 3.1 Identify your application type -### If your application is a standalone app +A JNLP app can be a **standalone application** or an **applet**. This is easy to spot on your `.jnlp` file with the tags **``** or **``** correspondingly. -Before jumping to the next steps, take a close look at content of `` and keep the following at hand: +We will create a basic HTML file where the CheerpJ runtime will be integrated and the java application displayed. Create this file in the root of the project folder. The way the app is loaded might differ if the application is a standalone app or an applet. The following steps will specify how the HTML will look like for each case. + +### 3.2 If your application is a standalone app + +Take a close look at content of `` and keep the following at hand: - **The application class name:** You can find it at the `main-class` attribute. This attribute may not be there if the class name is included in the manifest. - **The application arguments:** If any arguments are required, you will find these with the `` tag. @@ -91,9 +97,41 @@ Before jumping to the next steps, take a close look at content of ` [!note] Note > If you do not find any of the elements listed above, this means you do not need them to run your application. -Now you have everything you need until this point to run your JNLP app as a standalone application. Please continue to our [run a Java application] tutorial to run it in the browser with CheerpJ. +Example of an HTML file for an app where the class name is included in the manifest: + +```html title = "index.html" {6, 9-15} + + + + + CheerpJ test + + + + + + +``` + +Alternatively, if the class name is in the `.jnlp` file but not in the manifest, then replace [`cheerpjRunJar()`] for [`cheerpjRunMain()`]: + +```js +cheerpjRunMain( + "com.application.MyClassName", + "/app/my_application_archive.jar:/app/lib/my_dependency_archive.jar", +); +``` -### If your application is an applet +Any application arguments must be passed to [`cheerpjRunJar()`] or [`cheerpjRunMain()`]. +The `/app/`prefix is a virtual filesystem mount point that references the root of the web server this page is loaded from. + +### 3.2 If your application is an applet Take a close look to the `` tag on your `.jnlp` and keep the following at hand: @@ -103,13 +141,70 @@ Take a close look to the `` tag on your `.jnlp` and keep the follow - **The applet ideal size:** defined at `width` and `height` attributes. - **Applet parameters:** found as `` within `` if your applet requires it. -- **documentBase:** If you retrieve this URL, you will obtain an HTML file where the applet is wrapped. You can use it or create your own HTML file like [this one](/cheerpj3/getting-started/Java-applet#1-integrating-cheerpj-in-your-html-file). +- **documentBase:** If you retrieve this URL, you will obtain an HTML file where the applet is wrapped. You can use it, or create your own HTML like the example below. If you use the `documentBase` HTML file, remember to add the scripts where the CheerpJ runtime is integrated and called. + +The HTML for an applet would look like this: + +```html title="index.html" {6, 9-17} + + + + + CheerpJ applet test + + + + + + + +``` + +Any applet parameters should be passed as `` in the `` tag as usual: + +```html {7} + + + +``` + +> In case your users have a native Java plugin installed, you can replace the original HTML tag with a cheerpj- prefixed version. ``, ``, and `` are all supported. -Now you have everything you need until this point to run your JNLP app as an applet. Please continue to our [run a Java applet] tutorial to run it in the browser with CheerpJ. +## 4. Host your page + +Your final project directory tree should look similar to: + +``` +└── directory_name + ├── index.html + ├── my_application_archive.jar + └── lib + └── my_dependency.jar +``` + +You can now go to the project directory and serve this web page on a simple HTTP server, such as the http-server utility. + +```sh +cd directory_name +npm install http-server +http-server -p 8080 +``` ## The end -You are done setting up what you needed from your JNLP file. Now you can continue with the appropriate tutorial to run your app in the browser with CheerpJ. +This is the end of the tutorial. To learn more about running standalone applications and applets with CheerpJ, you can visit the dedicated tutorials: ## What is CheerpJ? From 2dbb23b2d58004e7e3207b6aba75d84781059c9f Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Wed, 25 Oct 2023 14:22:41 +0100 Subject: [PATCH 9/9] minor grammar changes --- src/content/docs/cheerpj3/10-getting-started/03-JNLP.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md b/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md index dc149450..f4ff16ea 100644 --- a/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md +++ b/src/content/docs/cheerpj3/10-getting-started/03-JNLP.md @@ -18,8 +18,8 @@ The `.jnlp` file contains the specifics of how to launch your Java application. Your `.jnlp` file might look something like the example below. There are three essential elements you need to find: 1. The `.jar` files specified under the `` element, usually indicated with a `` or `` tags. -2. Your application type. Seek for ` ` or `` tag. -3. You may need the `codebase` URL at ``. +2. Your application type. Look for an `` or `` tag. +3. You may need the `codebase` URL given by ``. ```xml title="example.jnlp" {5, 22-23, 26}