https://github.com/binki/binki-fool-java-os-version
Fool Java’s os.version by editing the value of release field in uname(2)
https://github.com/binki/binki-fool-java-os-version
Last synced: 2 months ago
JSON representation
Fool Java’s os.version by editing the value of release field in uname(2)
- Host: GitHub
- URL: https://github.com/binki/binki-fool-java-os-version
- Owner: binki
- License: mit
- Created: 2022-01-07T04:44:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-07T04:48:48.000Z (over 4 years ago)
- Last Synced: 2025-02-28T12:43:05.825Z (over 1 year ago)
- Language: C
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Fake `os.version` for Java
Strips `-` (dash) and any following text from `uname(2)`’s release field (i.e., from what shows up when you run `uname -r`).
It has been a while since I played with `LD_PRELOAD`, so I thought I would try it to see if this could be used as a workaround for [a misbehaving java package](https://unix.stackexchange.com/questions/685313).
## Output
```
binki@sam ~/repos/binki-fool-java-os-version/example $ javac PrintOsVersion.java
binki@sam ~/repos/binki-fool-java-os-version/example $ java PrintOsVersion
3.7.10-gentoobinkisamxen20130418
binki@sam ~/repos/binki-fool-java-os-version/example $ ../src/invoke-java.sh PrintOsVersion
3.7.10
```
## Compiling
In `src`, run `make`. Ensure you have the appropriate build tools installed first.