Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Graeb <[email protected]>
  • Loading branch information
TingDaoK and graebm authored Sep 13, 2024
1 parent cf326f3 commit 56763e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Since version v0.29.20, GraalVM native image was supported. You can compile your

Since version v0.30.12, GraalVM support was updated. Instead of packaging the JNI shared lib with native image as resource, the corresponding shared lib will be written to the same directory as the native image.
In this way, it reduces the native image size around 30%, and avoids the extra loading time needed for extracting the JNI lib to the temporary path for load. No additional configuration needed.
**Note**: the extracted JNI lib, `libaws-crt-jni.*` , will need to be exist in the directory containing the native image, if you move the native image to different directory.
**Note**: the JNI shared lib must be in the same directory as the GraalVM native image. If you move the native image, you must move this file too. It is `aws-crt-jni.dll` on Windows, `libaws-crt-jni.dylib` on macOS, and `libaws-crt-jni.so` on Unix.

## System Properties

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/software/amazon/awssdk/crt/CRT.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public final class CRT {
// otherwise, load from the jar this class is in
if (graalVMImageCode != null && graalVMImageCode == "runtime") {
throw new CrtRuntimeException(
"Unable to load AWS CRT lib for GraalVM runtime: Make sure the libaws-crt-jni exists in the the directory containing the native image");
"Failed to load '" + System.mapLibraryName(CRT_LIB_NAME) +
"'. Make sure this file is in the same directory as the GraalVM native image. ");
} else {
loadLibraryFromJar();
}
Expand Down

0 comments on commit 56763e6

Please sign in to comment.