Skip to content

Commit 8b3662a

Browse files
committed
adds client-maven-plugin configuration to compile with graal
1 parent 2ac0297 commit 8b3662a

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ If you peek into the ``javacv-webcam`` directory.
3131

3232
Attention: If you are using Windows or Linux you'll have to adapt module-info.java to include native libraries of suitable for those platforms. On MacOsX, you may have problems with permissions to access your webcam from a java application, make sure to allow access in your system preferences.
3333

34+
## Compile and run with client-maven-plugin
35+
36+
This project contains also a configuration for compiling it to a native image using [GraalVM](https://www.graalvm.org/). You have
37+
to download and install GraalVM in a recent version (I tested it with 20.2.0) and then compile and run it with following command:
38+
39+
mvn clean client:build client:run -Djavacpp.platform.custom -Djavacpp.platform.host -Dgraalvm.home=/path/to/your/graalvm/distribution
40+
41+
After downloading necessary toolings, dependencies and compiling and linking (takes some time) a JavaFX application which uses
42+
your webcam will start.
43+
3444
## Links
3545

3646
- Have a look at [https://openjfx.io](https://openjfx.io) where you can find more information and introductory examples for developing JavaFX applications.

pom.xml

+12-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>net.ladstatt.javacv</groupId>
55
<artifactId>javacv-webcam</artifactId>
6-
<version>2020.3.0-SNAPSHOT</version>
6+
<version>2020.3.1-SNAPSHOT</version>
77

88
<name>net.ladstatt.javacv.javacv-webcam</name>
99

@@ -15,11 +15,9 @@
1515
<javacv.version>1.5.4</javacv.version>
1616
<main.class>net.ladstatt.javacv.fx.WebcamFXApp</main.class>
1717
<!-- for native compilation with graalvm -->
18-
<!--
19-
<client.plugin.version>0.1.31</client.plugin.version>
20-
--><!-- other values can be ios,android -->
21-
<!--
18+
<client.plugin.version>0.1.33</client.plugin.version>
2219
<client.target>host</client.target>
20+
<!-- uncomment and provide your path
2321
<graalvm.home>/Users/lad/.sdkman/candidates/java/20.2.0.r11-grl</graalvm.home>
2422
-->
2523
</properties>
@@ -39,6 +37,14 @@
3937
<groupId>org.bytedeco</groupId>
4038
<artifactId>javacv-platform</artifactId>
4139
<version>${javacv.version}</version>
40+
<exclusions>
41+
<!-- if not excluded linking fails withc client-maven-plugin (???) -->
42+
<exclusion>
43+
<groupId>org.bytedeco</groupId>
44+
<artifactId>leptonica-platform</artifactId>
45+
</exclusion>
46+
</exclusions>
47+
4248
</dependency>
4349
</dependencies>
4450
<build>
@@ -76,7 +82,6 @@
7682
</execution>
7783
</executions>
7884
</plugin>
79-
<!--
8085
<plugin>
8186
<groupId>com.gluonhq</groupId>
8287
<artifactId>client-maven-plugin</artifactId>
@@ -100,11 +105,10 @@
100105
<resourcesList>
101106
<list>.*.dylib$</list>
102107
</resourcesList>
103-
<nativeImageArgs>- -allow-incomplete-classpath</nativeImageArgs>
108+
<nativeImageArgs>--allow-incomplete-classpath</nativeImageArgs>
104109
<graalvmHome>${graalvm.home}</graalvmHome>
105110
</configuration>
106111
</plugin>
107-
-->
108112
<plugin>
109113
<groupId>org.openjfx</groupId>
110114
<artifactId>javafx-maven-plugin</artifactId>

0 commit comments

Comments
 (0)