You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: graaljs/graaljs-webpack-guide/README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,17 +18,17 @@ JavaScript libraries can be integrated into standard Java applications using [Gr
18
18
You can do this with the [GraalVM Polyglot API](https://www.graalvm.org/latest/reference-manual/embed-languages/), which allows you to embed and interact with JavaScript directly from Java code.
19
19
20
20
GraalJS is available as both [Gradle](https://www.graalvm.org/javascript) and [Maven](https://central.sonatype.com/artifact/org.graalvm.polyglot/js) artifacts.
21
-
This makes it easy to add to your project regardless of your build tool.
21
+
This makes it easy to add GraalJS to your project regardless of the build tool.
22
22
Using Node (NPM) packages in Java projects often requires a bit more setup, due to the nature of the Node packaging ecosystem.
23
23
One way to use such modules is to prepackage them into a single _.js_ or _.mjs_ file using a bundler like [webpack](https://webpack.js.org/).
24
24
25
25
In this guide, you will integrate the `webpack` build into your Java project and embed the generated JavaScript code in your application's JAR file.
26
26
27
27
## Prerequisites
28
28
29
-
In this guide, you will add the [qrcode](https://www.npmjs.com/package/qrcode) NPM package to a Java application to generate QR codes.
29
+
This guide demonstrates how to add the [qrcode](https://www.npmjs.com/package/qrcode) NPM package to a Java application to generate QR codes.
30
30
31
-
To do this you will need:
31
+
You will need:
32
32
33
33
- JDK 21 or later
34
34
- Gradle 8.0 or later, or Maven 3.6.3 or later
@@ -43,11 +43,11 @@ You can use either **Gradle** or **Maven** to set up your Java project:
43
43
- for Gradle projects, navigate to the Gradle folder with `cd gradle`
44
44
- for Maven projects, navigate to the Maven folder with `cd maven`
45
45
46
-
### Create a new Gradle Java Project
46
+
Create a New Gradle Java Project
47
47
48
48
You can start with any Gradle Java project.
49
49
50
-
If you don’t have one yet run the following:
50
+
Run the following command to create a new project with Gradle:
51
51
52
52
```shell
53
53
gradle init --type java-application
@@ -425,14 +425,14 @@ You can cast the exported `QRCode` object to the declared `QRCode` interface so
425
425
426
426
## 4. Building and Running the Application
427
427
428
-
If using Gradle, build and run your application using:
428
+
If using Gradle, run the following commands to build and run your application:
429
429
430
430
```shell
431
431
./gradlew build
432
432
./gradlew run --args="https://www.graalvm.org/"
433
433
```
434
434
435
-
If using Maven, build and run your application using:
435
+
If using Maven, run the following commands to build and run your application:
0 commit comments