Skip to content

Commit 8db08aa

Browse files
committed
Prepare for release 0.7
1 parent 56d0145 commit 8db08aa

File tree

17 files changed

+202
-36
lines changed

17 files changed

+202
-36
lines changed

.github/workflows/continuous-integration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ jobs:
4747
run: ./mvnw $MAVEN_ARGS clean compile
4848
working-directory: ./examples/enumerate
4949
- name: Example "enumerate" (Kotlin)
50-
run: ./mvnw $MAVEN_ARGS clean compile
50+
run: ./mvnw $MAVEN_ARGS clean package
5151
working-directory: ./examples/enumerate_kotlin
5252
- name: Example "monitor"
5353
run: ./mvnw $MAVEN_ARGS clean compile
5454
working-directory: ./examples/monitor
5555
- name: Example "monitor" (Kotlin)
56-
run: ./mvnw $MAVEN_ARGS clean compile
56+
run: ./mvnw $MAVEN_ARGS clean package
5757
working-directory: ./examples/monitor_kotlin
5858
- name: Example "stm_dfu"
5959
run: ./mvnw $MAVEN_ARGS clean compile

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The library uses the [Foreign Function & Memory API](https://github.com/openjdk/
88

99
| Version | Main New Features | Compatibility |
1010
| - | - | - |
11-
| 0.7.x | Prerelease: New setter/getter names for improved Kotlin support; Kotlin examples | JDK 21 |
11+
| 0.7.x | New setter/getter names for improved Kotlin support; Kotlin examples | JDK 21 |
1212
| 0.6.x | Support for JDK 21; better handling of composite devices on Windows | JDK 21 |
1313
| 0.5.x | Support for JDK 20; high-throuput I/O streams | JDK 20 |
1414
| 0.4.x | Early release | JDK 19 |
@@ -48,14 +48,14 @@ If you are using Maven, add the below dependency to your pom.xml:
4848
<dependency>
4949
<groupId>net.codecrete.usb</groupId>
5050
<artifactId>java-does-usb</artifactId>
51-
<version>0.6.1</version>
51+
<version>0.7.0</version>
5252
</dependency>
5353
```
5454

5555
If you are using Gradle, add the below dependency to your build.gradle file:
5656

5757
```groovy
58-
compile group: 'net.codecrete.usb', name: 'java-does-usb', version: '0.6.1'
58+
compile group: 'net.codecrete.usb', name: 'java-does-usb', version: '0.7.0'
5959
```
6060

6161
```java
@@ -134,9 +134,26 @@ The library has not been tested on Windows for ARM64. It might or might not work
134134

135135
### Troubleshooting
136136

137-
- The error `java.lang.ClassFormatError: Illegal field name "" in class net/codecrete/usb/windows/WindowsUsbDeviceRegistry` is caused by a bug in JDK 21, which has been fixed in the mean-time. Please upgrade to the latest release of JDK 21.
137+
#### `ClassFormatError` (all platforms)
138138

139-
- The error `Cannot open library: CoreFoundation.framework/CoreFoundation` is caused by an unfortunate build of the OpenJDK by Homebrew. Please use any other JDK edition instead, e.g. Zulu (`brew install zulu` or directly from https://www.azul.com/downloads/#zulu), Temurin (`brew install temurin` or from https://adoptium.net/en-GB/temurin/releases/), or download the official OpenJDK directly from https://openjdk.org/projects/jdk/21/. And don't forget to uninstall the Homebrew build (`brew uninstall openjdk`).
139+
The error `java.lang.ClassFormatError: Illegal field name "" in class net/codecrete/usb/windows/WindowsUsbDeviceRegistry` is caused by a bug in JDK 21, which has been fixed in the mean-time. Please upgrade to the latest release of JDK 21 (at least 21.0.1).
140+
141+
142+
#### `Cannot open library` (macOS only)
143+
144+
The error `Cannot open library: CoreFoundation.framework/CoreFoundation` is caused by an unfortunate build of the OpenJDK by Homebrew. Please use any other JDK edition instead, e.g. Zulu (`brew install zulu` or directly from https://www.azul.com/downloads/#zulu), Temurin (`brew install temurin` or from https://adoptium.net/en-GB/temurin/releases/), or download the official OpenJDK directly from https://openjdk.org/projects/jdk/21/.
145+
146+
It will usually not be possible to uninstall the problematic build (`brew uninstall openjdk`) as it is a dependency of other brew packages. So to run an application, set `JAVA_HOME`:
147+
148+
```shell
149+
export JAVA_HOME=/Users/me/Documents/zulu21.30.15-ca-jdk21.0.1-macosx_aarch64
150+
```
151+
152+
If the JDK was "installed" as opposed to downloaded, the path for `JAVA_HOME` will likely be listed by:
153+
154+
```sheel
155+
/usr/libexec/java_home -V
156+
```
140157

141158

142159
### 32-bit versions

examples/bulk_transfer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ $ mvn compile exec:exec
3939
[INFO] Scanning for projects...
4040
[INFO]
4141
[INFO] --------------< net.codecrete.usb.examples:bulk-transfer >--------------
42-
[INFO] Building bulk-transfer 0.6.1
42+
[INFO] Building bulk-transfer 0.7.0
4343
[INFO] --------------------------------[ jar ]---------------------------------
4444
[INFO]
4545
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ bulk-transfer ---

examples/bulk_transfer/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>net.codecrete.usb.examples</groupId>
88
<artifactId>bulk-transfer</artifactId>
9-
<version>0.6.1</version>
9+
<version>0.7.0</version>
1010

1111
<name>bulk-transfer</name>
1212
<url>https://github.com/manuelbl/JavaDoesUSB/examples/bulk_transfer</url>
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>net.codecrete.usb</groupId>
2323
<artifactId>java-does-usb</artifactId>
24-
<version>0.7.0-SNAPSHOT</version>
24+
<version>0.7.0</version>
2525
</dependency>
2626
</dependencies>
2727

examples/enumerate/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $ mvn compile exec:exec
3838
[INFO] Scanning for projects...
3939
[INFO]
4040
[INFO] ----------------< net.codecrete.usb.examples:enumerate >----------------
41-
[INFO] Building enumerate 0.6.1
41+
[INFO] Building enumerate 0.7.0
4242
[INFO] --------------------------------[ jar ]---------------------------------
4343
[INFO]
4444
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ enumerate ---

examples/enumerate/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>net.codecrete.usb.examples</groupId>
88
<artifactId>enumerate</artifactId>
9-
<version>0.6.1</version>
9+
<version>0.7.0</version>
1010

1111
<name>enumerate</name>
1212
<url>https://github.com/manuelbl/JavaDoesUSB/examples/enumerate</url>
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>net.codecrete.usb</groupId>
2323
<artifactId>java-does-usb</artifactId>
24-
<version>0.7.0-SNAPSHOT</version>
24+
<version>0.7.0</version>
2525
</dependency>
2626
<dependency>
2727
<groupId>org.tinylog</groupId>

examples/enumerate_kotlin/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# USB Device Enumeration (Kotlin)
2+
3+
This sample enumerates the connected USB devices and provides information about the interfaces and endpoints.
4+
5+
## Prerequisites
6+
7+
- Java 21
8+
- Apache Maven
9+
- 64-bit operating system (Windows, macOS, Linux)
10+
11+
## How to run
12+
13+
### Install Java 21
14+
15+
Check that *Java 21* is installed:
16+
17+
```shell
18+
$ java -version
19+
```
20+
21+
If not, download and install it, e.g. from [Azul](https://www.azul.com/downloads/?package=jdk).
22+
23+
### Install Maven
24+
25+
Check that *Maven* is installed:
26+
27+
```shell
28+
$ mvn -version
29+
```
30+
31+
If it is not present, install it, typically using package manager like *Homebrew* on macOS, *Chocolately* on Windows and *apt* on Linux.
32+
33+
### Build a self-contained jar file
34+
35+
```shell
36+
$ cd JavaDoesUSB/examples/enumerate_kotlin
37+
$ mvn clean package
38+
```
39+
40+
### Run the jar
41+
42+
```shell
43+
$ java --enable-preview --enable-native-access=ALL-UNNAMED -jar target/enumerate-0.7.0-jar-with-dependencies.jar
44+
Device:
45+
VID: 0xcafe
46+
PID: 0xceaf
47+
Manufacturer: JavaDoesUSB
48+
Product name: Loopback
49+
...
50+
```

examples/enumerate_kotlin/pom.xml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
<modelVersion>4.0.0</modelVersion>
44

55
<groupId>net.codecrete.usb.examples</groupId>
6-
<artifactId>kotlin</artifactId>
7-
<version>0.6.1-SNAPSHOT</version>
6+
<artifactId>enumerate</artifactId>
7+
<version>0.7.0</version>
88
<packaging>jar</packaging>
99

10-
<name>kotlin</name>
11-
<url>https://github.com/manuelbl/JavaDoesUSB/examples/kotlin</url>
10+
<name>enumerate</name>
11+
<url>https://github.com/manuelbl/JavaDoesUSB/examples/enumerate_kotlin</url>
1212

1313
<properties>
14-
<kotlin.version>1.9.10</kotlin.version>
14+
<kotlin.version>1.9.22</kotlin.version>
1515
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<main.class>net.codecrete.usb.examples.EnumerateKt</main.class>
1718
</properties>
1819

1920
<build>
@@ -27,6 +28,30 @@
2728
<version>${kotlin.version}</version>
2829
<extensions>true</extensions>
2930
</plugin>
31+
<plugin>
32+
<groupId>org.apache.maven.plugins</groupId>
33+
<artifactId>maven-assembly-plugin</artifactId>
34+
<version>3.6.0</version>
35+
<executions>
36+
<execution>
37+
<id>make-assembly</id>
38+
<phase>package</phase>
39+
<goals>
40+
<goal>single</goal>
41+
</goals>
42+
<configuration>
43+
<archive>
44+
<manifest>
45+
<mainClass>${main.class}</mainClass>
46+
</manifest>
47+
</archive>
48+
<descriptorRefs>
49+
<descriptorRef>jar-with-dependencies</descriptorRef>
50+
</descriptorRefs>
51+
</configuration>
52+
</execution>
53+
</executions>
54+
</plugin>
3055
</plugins>
3156
</build>
3257

@@ -39,7 +64,7 @@
3964
<dependency>
4065
<groupId>net.codecrete.usb</groupId>
4166
<artifactId>java-does-usb</artifactId>
42-
<version>0.7.0-SNAPSHOT</version>
67+
<version>0.7.0</version>
4368
</dependency>
4469
<dependency>
4570
<groupId>org.tinylog</groupId>

examples/epaper_display/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ $ mvn compile exec:exec
4545
[INFO] Scanning for projects...
4646
[INFO]
4747
[INFO] -------------< net.codecrete.usb.examples:epaper-display >--------------
48-
[INFO] Building epaper-display 0.6.1
48+
[INFO] Building epaper-display 0.7.0
4949
[INFO] from pom.xml
5050
[INFO] --------------------------------[ jar ]---------------------------------
5151
[INFO]
@@ -81,6 +81,6 @@ $ sudo -i
8181
Password:
8282
$ cd /Users/me/Documents/JavaDoesUSB/examples/epaper_display
8383
$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-20.jdk/Contents/Home
84-
$ $JAVA_HOME/bin/java --enable-preview --enable-native-access=ALL-UNNAMED -cp target/classes:/Users/me/.m2/repository/net/codecrete/usb/java-does-usb/0.6.1/java-does-usb-0.6.1.jar net.codecrete.usb.examples.EPaperDisplay
84+
$ $JAVA_HOME/bin/java --enable-preview --enable-native-access=ALL-UNNAMED -cp target/classes:/Users/me/.m2/repository/net/codecrete/usb/java-does-usb/0.7.0/java-does-usb-0.7.0.jar net.codecrete.usb.examples.EPaperDisplay
8585
Display size: 1200 x 825
8686
```

examples/epaper_display/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>net.codecrete.usb.examples</groupId>
88
<artifactId>epaper-display</artifactId>
9-
<version>0.6.1</version>
9+
<version>0.7.0</version>
1010

1111
<name>epaper-display</name>
1212
<url>https://github.com/manuelbl/JavaDoesUSB/examples/epaper_display</url>
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>net.codecrete.usb</groupId>
2323
<artifactId>java-does-usb</artifactId>
24-
<version>0.7.0-SNAPSHOT</version>
24+
<version>0.7.0</version>
2525
</dependency>
2626
</dependencies>
2727

0 commit comments

Comments
 (0)