From 599d502a05434612dbcb99f0ae1c148c68ed35da Mon Sep 17 00:00:00 2001 From: Rijul Shrestha Date: Tue, 28 Oct 2025 13:56:35 +0000 Subject: [PATCH 1/2] Fixed the typo in example title --- .../src/content/docs/11-guides/implementing-native-libraries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/cheerpj/src/content/docs/11-guides/implementing-native-libraries.md b/sites/cheerpj/src/content/docs/11-guides/implementing-native-libraries.md index ef4c38ee..e5b95bdf 100644 --- a/sites/cheerpj/src/content/docs/11-guides/implementing-native-libraries.md +++ b/sites/cheerpj/src/content/docs/11-guides/implementing-native-libraries.md @@ -116,7 +116,7 @@ export default { - Native Method Example + Native Library Example From 46fe0c1d1377b3ae0e3b66c3a3b6fd1bfa7fc9fc Mon Sep 17 00:00:00 2001 From: Rijul Shrestha Date: Tue, 28 Oct 2025 15:42:52 +0000 Subject: [PATCH 2/2] Minor changes with format and grammar for consistency --- .../docs/10-getting-started/00-Java-app.md | 24 +++++++++---------- .../10-getting-started/01-Java-applet.mdx | 6 ++--- .../10-getting-started/02-Java-library.md | 14 +++++------ .../docs/10-getting-started/03-JNLP.mdx | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sites/cheerpj/src/content/docs/10-getting-started/00-Java-app.md b/sites/cheerpj/src/content/docs/10-getting-started/00-Java-app.md index e4c62f5e..d3fc5ed3 100644 --- a/sites/cheerpj/src/content/docs/10-getting-started/00-Java-app.md +++ b/sites/cheerpj/src/content/docs/10-getting-started/00-Java-app.md @@ -1,5 +1,5 @@ --- -title: Run a Java application +title: Run a Java Application description: Convert a desktop app to a webapp --- @@ -10,12 +10,12 @@ Java source code is not needed to use CheerpJ. If you are building your own appl **To get started you will need:** - Your Java application file(s). You can also use this [TextDemo.jar](https://docs.oracle.com/javase/tutorialJWS/samples/uiswing/TextDemoProject/TextDemo.jar) sample. -- An HTML file where your Java app will be wrapped -- A simple HTTP server to test your webpage locally +- An HTML file where your Java app will be wrapped. +- A simple HTTP server to test your webpage locally. ## 1. Create a project directory -Let's start by creating a project folder where all your files will be. Please copy your java and future HTML files here. +Let's start by creating a project folder where all your files will be. Copy your java and future HTML files here. ```shell @@ -32,7 +32,7 @@ Let's create a basic HTML file like the following example. Please notice the Che - CheerpJ test + CheerpJ Java App Example @@ -56,7 +56,7 @@ cheerpjRunMain( ); ``` -> [!help] Don't forget to use the /app/ prefix +> [!note] Don't forget to use the /app/ prefix > It is common for first-time users to forget to add the prefix “/app/” when passing the application location to cheerpJRunJar() or cheerpjRunMain(). ## 3. Host your page @@ -67,9 +67,13 @@ You can now serve this web page on a simple HTTP server, such as the http-server npx http-server -p 8080 ``` -> [!tip] +> [!note] Info > Opening the page directly from the disk (for example, by double-clicking on it) is not supported. +## The result + +You will see the CheerpJ display on your browser with some loading messages before showing your application running. Depending on your application and the optimizations applied, this could take just a few seconds. + ## What's going on? - The `` script loads CheerpJ. @@ -78,13 +82,9 @@ npx http-server -p 8080 - [`cheerpjRunJar`] executes your application! - `/app/` is a [virtual filesystem] mount point that references the root of the web server this page is loaded from. -## The result - -You will see the CheerpJ display on your browser with some loading messages before showing your application running. Depending on your application and the optimizations applied, this could take just a few seconds. - ### Is your application not working? -Please try these checks: +If your application doesn't work, check the following: - The location of your JARs is correct and the prefix `/app/` is added when passing it to [`cheerpjRunJar`] or [`cheerpjRunMain`]. For more information visit the [virtual filesystem] guide. - Your Java application works normally on your machine without CheerpJ. diff --git a/sites/cheerpj/src/content/docs/10-getting-started/01-Java-applet.mdx b/sites/cheerpj/src/content/docs/10-getting-started/01-Java-applet.mdx index cec0d9e9..4cbc90ec 100644 --- a/sites/cheerpj/src/content/docs/10-getting-started/01-Java-applet.mdx +++ b/sites/cheerpj/src/content/docs/10-getting-started/01-Java-applet.mdx @@ -1,5 +1,5 @@ --- -title: Run a Java applet +title: Run a Java Applet description: Run a java applet in modern browsers --- @@ -23,7 +23,7 @@ CheerpJ can run Java applets in the browser seamlessly. This page will help you ## Running your own applet -**You will need:** +**To get started you will need:** - Your applet file(s) - The HTML file where your applet is meant to be displayed. @@ -56,7 +56,7 @@ For example: - CheerpJ applet test + CheerpJ Applet Example diff --git a/sites/cheerpj/src/content/docs/10-getting-started/02-Java-library.md b/sites/cheerpj/src/content/docs/10-getting-started/02-Java-library.md index a9c812a5..a348bf2f 100644 --- a/sites/cheerpj/src/content/docs/10-getting-started/02-Java-library.md +++ b/sites/cheerpj/src/content/docs/10-getting-started/02-Java-library.md @@ -1,5 +1,5 @@ --- -title: Run a Java library +title: Run a Java Library description: Use Java classes in JavaScript --- @@ -13,7 +13,7 @@ Java source code is not required to use CheerpJ. If you are using your own libra - An HTML file where your Java app will be wrapped. - A simple HTTP server to test your webpage locally. -## 1. Create a Project Directory +## 1. Create a project directory Let's start by creating a project folder where all your files will be. Copy your java and future HTML files here. @@ -21,7 +21,7 @@ Let's start by creating a project folder where all your files will be. Copy your mkdir directory_name ``` -## 2. Create a Basic HTML File +## 2. Create a basic HTML file Let's create a basic HTML file and include and initialize CheerpJ on your page. The `cheerpjInit` command initialises the CheerpJ runtime environment. @@ -41,7 +41,7 @@ Let's create a basic HTML file and include and initialize CheerpJ on your page. ``` -## 3. Load and Call the Java Library From Java +## 3. Load and call the Java library from JavaScript Now we can load your Java library by calling `cheerpjRunLibrary` which will load the library from the root of your web server. We are assuming your HTML file and your `.jar` files are under the project directory you just created. @@ -50,7 +50,7 @@ Now we can load your Java library by calling `cheerpjRunLibrary` which will load - CheerpJ Library Mode Test + CheerpJ Library Mode Example @@ -66,7 +66,7 @@ Now we can load your Java library by calling `cheerpjRunLibrary` which will load ``` -## 3. Host your page +## 4. Host your page You can now serve this web page on a simple HTTP server, such as the http-server utility. @@ -74,7 +74,7 @@ You can now serve this web page on a simple HTTP server, such as the http-server npx http-server -p 8080 ``` -## The Result +## The result You will see CheerpJ initialize in your browser and load the Java library. Once loaded, the methods from your library can be called directly from JavaScript, just as in the example above. Depending on the size of your library and the optimizations applied, this may take just a few seconds before your code begins executing. diff --git a/sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx b/sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx index 9b78f0c6..927fae23 100644 --- a/sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx +++ b/sites/cheerpj/src/content/docs/10-getting-started/03-JNLP.mdx @@ -18,7 +18,7 @@ This quickstart tutorial will take you step by step on how to run your JNLP app -You will need: +**To get started you will need:** - The application `.jnlp` file. - An HTML file where your Java app will be wrapped. @@ -217,7 +217,7 @@ cd directory_name npx http-server -p 8080 ``` -## The end +## Further reading This is the end of the tutorial. To learn more about running standalone applications and applets with CheerpJ, you can visit the dedicated tutorials: