Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java version messaging to users is inconsistent between Windows and Linux 'refine' scripts #4930

Closed
thadguidry opened this issue Jun 6, 2022 · 0 comments · Fixed by #4949
Assignees
Labels
Good First Issue Indicates issues suitable for newcomers to design or coding, providing a gentle introduction. help wanted An issue that we would love anyone to help us with java version compatibility Making sure OpenRefine runs on as many Java versions as possible Type: Bug Issues related to software defects or unexpected behavior, which require resolution.

Comments

@thadguidry
Copy link
Member

thadguidry commented Jun 6, 2022

If a user has set their %JAVA_HOME% env variable on Windows but the %PATH% variable has a different Java version for the runtime and is lower than the compiled class file version 55.0 (Java 11) then users will notice an error and failure during startup even though the Java version check was successful.

To Reproduce

Steps to reproduce the behavior:

  1. First, set %JAVA_HOME% to a path having Java 8 Update 333
  2. Keep %PATH% env variable set to Java 11 runtime
  3. Then, run refine.bat

Current Results

E:\GitHub Repos\OpenRefine>refine
Using refine.ini for configuration
Getting Java Version...
openjdk version "11.0.14.1" 2022-02-08
OpenJDK Runtime Environment Temurin-11.0.14.1+1 (build 11.0.14.1+1)
OpenJDK 64-Bit Server VM Temurin-11.0.14.1+1 (build 11.0.14.1+1, mixed mode)
=====================================================
Getting Free Ram...
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/refine/Refine has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Expected Behavior

Windows

Since we now really depend on %JAVA_HOME% when setting the CLASSPATH in the refine.bat script for Windows, we should fully use %JAVA_HOME% for the Java version inspection and logging to support.log.

We currently have good support for checking the Java versions we support and reporting errors in our refine script for Linux and should ideally incorporate that checkJavaMajorVersion() functionality and adapt it into our refine.bat script for Windows. That way we are consistent with our Java error messaging to users on both platforms.

Linux

One of the additional things in the refine Linux script seems to be that we are not using the $JAVA_HOME env variable during the checkJavaMajorVersion() either but instead always a $JAVA variable. We should ideally always refer to and use $JAVA_HOME as a best practice in our version checking and classpath setup for refine startup, no matter the OS, since that is standard practice and gives users the ability to control their own Java environment or symbolically link to a different one.

Screenshots

Versions

  • Operating System: Windows 11 and Linux
  • Browser Version: Edge latest and Chrome
  • JRE or JDK Version: openjdk version "11.0.14.1" 2022-02-08
  • OpenRefine: master branch

Datasets

Additional context

@thadguidry thadguidry added Type: Bug Issues related to software defects or unexpected behavior, which require resolution. Good First Issue Indicates issues suitable for newcomers to design or coding, providing a gentle introduction. java version compatibility Making sure OpenRefine runs on as many Java versions as possible help wanted An issue that we would love anyone to help us with labels Jun 6, 2022
@elebitzero elebitzero self-assigned this Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Indicates issues suitable for newcomers to design or coding, providing a gentle introduction. help wanted An issue that we would love anyone to help us with java version compatibility Making sure OpenRefine runs on as many Java versions as possible Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants