Skip to content

Commit

Permalink
v0.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
astonbitecode committed Jan 31, 2025
1 parent 4c883ed commit 05d2963
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "java-locator"
version = "0.1.8"
version = "0.1.9"
authors = ["aston <[email protected]>"]
description = "Locates a Java installation in the host."
keywords = ["java", "jni"]
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ The latter two commands should return something like:

> /usr/lib/jvm/java-11-openjdk-amd64/lib
## Available Features

* `build-binary`: Generates a `java-locator` executable
* `locate-jdk-only`: Instructs `java-locator` to locate __only JDKs__.

In a system that has only JREs installed, `java-locator` will not find any Java installation if this feature is enabled.

This feature also solves issues when using JDK 8: In usual installations, the symlinks of the `java` executable in the `$PATH`
lead to the `jre` directory that lies inside the JDK 8. When `$JAVA_HOME` is not defined in the system, `java-locator` attempts to locate the
Java installation following the symlinks of the `java` executable. Having done that, it cannot locate development artifacts like `jni.h` headers,
`javac` etc. With this feature enabled though, `java-locator` will locate development artifacts normally.

## License

At your option, under:
Expand Down
15 changes: 10 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,17 @@ The latter two commands should return something like:
> /usr/lib/jvm/java-11-openjdk-amd64/lib
## Extra Features
## Available Features
* `locate-jdk-only`: Attempts to locate the JDK by searching for the Java compiler,
as opposed to searching for the runtime.
This solves issues in JDK 8 where the JRE resides in a subdirectory and not in the JDK root,
so development files are not found in JAVA_HOME as would be expected.
* `build-binary`: Generates a `java-locator` executable
* `locate-jdk-only`: Instructs `java-locator` to locate __only JDKs__.
In a system that has only JREs installed, `java-locator` will not find any Java installation if this feature is enabled.
This feature also solves issues when using JDK 8: In usual installations, the symlinks of the `java` executable in the `$PATH`
lead to the `jre` directory that lies inside the JDK 8. When `$JAVA_HOME` is not defined in the system, `java-locator` attempts to locate the
Java installation following the symlinks of the `java` executable. Having done that, it cannot locate development artifacts like `jni.h` headers,
`javac` etc. With this feature enabled though, `java-locator` will locate development artifacts normally.
## License
Expand Down

0 comments on commit 05d2963

Please sign in to comment.