Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Logstash core will continue to exist under this repository and all related issue

### Prerequisites

* Install JDK version 11 or 17. Make sure to set the `JAVA_HOME` environment variable to the path to your JDK installation directory. For example `set JAVA_HOME=<JDK_PATH>`
* Install JRuby 9.2.x It is recommended to use a Ruby version manager such as [RVM](https://rvm.io/) or [rbenv](https://github.com/sstephenson/rbenv).
* Install JDK version 21. Make sure to set the `JAVA_HOME` environment variable to the path to your JDK installation directory. For example `set JAVA_HOME=<JDK_PATH>`
* Install JRuby 10.0.5.0 It is recommended to use a Ruby version manager such as [RVM](https://rvm.io/) or [rbenv](https://github.com/sstephenson/rbenv).
* Install `rake` and `bundler` tool using `gem install rake` and `gem install bundler` respectively.

### RVM install (optional)
Expand Down
4 changes: 2 additions & 2 deletions logstash-core/lib/logstash/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ def execute
deprecation_logger.deprecated msg
end

if JavaVersion::CURRENT < JavaVersion::JAVA_17
deprecation_logger.deprecated I18n.t("logstash.runner.java.version_17_minimum",
if JavaVersion::CURRENT < JavaVersion::JAVA_21
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is now no longer reachable? I think bailOnOldJava would stop execution before this can execute. We would introduce this again if there were multiple java versions supported (and one was to be deprecated soon).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right that it is likely unreachable. Let's file a separate ticket to chase it. For now I'm just updating the bits that are there just in case there is a path to it that I can't think of.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprecation_logger.deprecated I18n.t("logstash.runner.java.version_21_minimum",
:java_home => java.lang.System.getProperty("java.home"))
end

Expand Down
4 changes: 2 additions & 2 deletions logstash-core/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ en:
Running Logstash with the bundled JDK is recommended.
The bundled JDK has been verified to work with each specific version of Logstash, and generally provides best performance and reliability.
If you have compelling reasons for using your own JDK (organizational-specific compliance requirements, for example), you can configure LS_JAVA_HOME to use that version instead.
version_17_minimum: >-
Starting from Logstash 9.0, the minimum required version of Java is Java 17;
version_21_minimum: >-
Starting from Logstash 9.4, the minimum required version of Java is Java 21;
your Java version from `%{java_home}` does not meet this requirement.
Running Logstash with the bundled JDK is recommended.
The bundled JDK has been verified to work with each specific version of Logstash, and generally provides best performance and reliability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
public class JavaVersion implements Comparable<JavaVersion> {

public static final JavaVersion CURRENT = parse(System.getProperty("java.specification.version"));
public static final JavaVersion JAVA_17 = parse("17");
public static final JavaVersion JAVA_21 = parse("21");

private final List<Integer> version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* Helper class to compare current version of JVM with a target version.
Expand All @@ -30,7 +31,7 @@
public class JavaVersion implements Comparable<JavaVersion> {

public static final JavaVersion CURRENT = parse(System.getProperty("java.specification.version"));
public static final JavaVersion JAVA_17 = parse("17");
public static final JavaVersion JAVA_21 = parse("21");
private final List<Integer> version;

private JavaVersion(List<Integer> version) {
Expand Down Expand Up @@ -81,4 +82,9 @@ private static int compare(final JavaVersion leftVersion, final JavaVersion righ
public int compareTo(JavaVersion other) {
return compare(this, other);
}

@Override
public String toString() {
return version.stream().map(Object::toString).collect(Collectors.joining("."));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ public static void main(final String[] args) {
}

static void bailOnOldJava() {
if (JavaVersion.CURRENT.compareTo(JavaVersion.JAVA_17) < 0) {
if (JavaVersion.CURRENT.compareTo(JavaVersion.JAVA_21) < 0) {
final String message = String.format(
Locale.ROOT,
"The minimum required Java version is 17; your Java version from [%s] does not meet this requirement",
System.getProperty("java.home")
);
"The minimum required Java version is 21; your Java version from [%s] is [%s] and does not meet this requirement",
System.getProperty("java.home"),
JavaVersion.CURRENT
);
System.err.println(message);
System.exit(1);
}
Expand Down
Loading