Commit Graph

17 Commits

Author SHA1 Message Date
Ryan Dill
595dc6df93 (MODULES-10935) - Switch legacy operatingsystem fact to modern kernel 2021-02-08 03:28:11 -08:00
David Schmitt
f9d03a10ac Apply remaining rubocop fixes 2020-12-16 17:36:26 +00:00
David Schmitt
fdbccc3435 Add the FrozenStrings magic comment 2020-12-16 13:44:14 +00:00
Tim Eilers
4f52cee832 Fixing java_version fact, because OpenJDK puts a date after version 2020-01-14 14:17:18 +02:00
Jeroen Hooyberghs
21d39590b0 Add support for java 11, the default in debian buster 10 2019-09-10 12:21:19 +02:00
Will Meek
dec5136e11 Cleanup ruby code via rubocop
This commit will add code cleanup as corrected
and alerted by rubocop. It also adds rules to
execute rubocop on Travis.
2017-11-21 14:31:45 +00:00
Sebastian Reitenbach
bdfc567c18 OpenBSD doesn't have /etc/environment, therefore there is no
need to fiddle with it. The default case statement, "do nothing"
is all fine here.

Facter::Util::Resolution.with_env is long time gone since
Facter > 2.x. That was even longer before introduced by me.
Remove that OpenBSD special case in the java_version fact,
and assume that $PATH is properly set in order to find
the 'java' binary.

Additionally confine the java_default_home and java_libjvm_path
to OpenBSD kernel as well. Add some flesh to the java_default_home
fact to allow it to find the java binary.
2017-11-15 14:37:42 +00:00
shuebnersr
b7bdf96252 Fixed search for matching line with java version
Use value of variable instead of return statement
Extended unit test for checking handling of JAVA_TOOL_OPTIONS
2017-10-01 15:15:01 +02:00
shuebnersr
d89532435d search for matching line with java version
do not just try to read java version from first line, but search for the matching line from java output
2017-09-20 14:26:04 +02:00
Vadym Chepkov
797677caf7 [MODULES-4736] Increase Xmx setting for java_version fact
Previous value of 8M caused JVM to crash on servers with more then 40G of RAM
Tested on databases servers up to 1.5T of RAM, 12M seems to be sufficient
2017-04-19 07:47:07 -04:00
David Schmitt
dadc7a6c22 (MODULES-2637) Checks java actually installed
The other method for running which java doesn't work on OSX, as java is installed as an empty shim when not installed in the base OSX image:

```
vagrant:~ vagrant$ java
No Java runtime present, requesting install.
vagrant:~ vagrant$ /usr/libexec/java_home --failfast
Unable to find any JVMs matching version "(null)".
vagrant:~ vagrant$
```

We can use the `/usr/libexec/java_home --failfast` command to check if
java is actually present first.

Originally-by: Peter Souter <peter.souter@puppetlabs.com>
2015-10-01 19:09:32 +01:00
Sebastian Reitenbach
5815242f8e Add support for OpenBSD, and also add some regression tests.
Add info about OpenBSD support to README.md and metadata.json
Add a note about OpenBSD java_version fact to README.markdown.
Fixup wording on context in one of the java patch level regression tests.
No mentioning of OpenBSD in metdata.json

Cleanup wording of context as suggested by @elyscape
update contexts as suggested by @elyscape
2015-04-23 12:29:11 +02:00
Eli Young
8dd715a599 Improve java_version fact maintainability 2015-02-09 15:26:53 -08:00
Oliver Falk
79805000cc (MODULES-1749) Update java_version fact...
with maximum memory size

Add -Xmx8m to make large systems happy.
2015-02-06 12:47:23 +00:00
Peter Souter
cd3ac1ee46 (MODULES-1570) Add java_major_version fact
Gives the major version of the Java release (ie. Java 1.7.0_71, major version is 7)

We also want to specifically return nil when java not present
2015-01-07 15:42:23 -08:00
Peter Souter
5168f61c26 (MODULES-1570) Improve variable names
Lets keep it vaguely consistent
2014-12-29 15:13:47 +00:00
Peter Souter
8724592f2b (MODULES-1570) java_version fact
Adapted from the many found on Github, simply runs `java -version` and strips the results. From what I can find there aren't many edge cases for the result `java -version 2>&1` could return, so this should be fairly compatible.
2014-12-29 15:13:47 +00:00