-
Notifications
You must be signed in to change notification settings - Fork 18
Add introduction and Library Mode reference to "Run a Java Library" #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can still add a bit more context to the introduction. Have a look at the other Getting Started pages, they all describe what files are needed and show more of the HTML page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page looks really nice now. I requested some small changes and after that it should be ready.
| const cj = await cheerpjRunLibrary("/app/library.jar"); | ||
| const MyClass = await cj.com.library.MyClass; | ||
| const obj = await new MyClass(); | ||
| await obj.myMethod(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a comment here that these are example classes and will look different for whatever library you are using.
| ## 2. Initialize CheerpJ and load your Java library | ||
| ## 2. Create a Basic HTML File | ||
|
|
||
| Let's create a basic HTML file and include and initialize CheerpJ on your page. cheerpjInit initialises the CheerpJ runtime environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this:
cheerpjInit initialises the CheerpJ runtime environment.
To this, to make it more clear. And add the ` symbols to highlight it as a command:
The `cheerpjInit` command initialises the CheerpJ runtime environment.
| ## 3. Load and Call the Java Library From Java | ||
|
|
||
| This will load `library.jar` from the root of your web server. | ||
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cheerpjRunLibrary -> `cheerpjRunLibrary`
.jar -> `.jar`
No description provided.