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

JVM version error with maven #198

Open
cxrodgers opened this issue Feb 4, 2023 · 3 comments
Open

JVM version error with maven #198

cxrodgers opened this issue Feb 4, 2023 · 3 comments

Comments

@cxrodgers
Copy link

Hello, I am trying to install from source on Linux Mint. I previously was using ImageJ 1.53o which I downloaded for Linux from https://imagej.net/software/fiji/downloads. Recently I started getting errors from Fiji about my java version being too old / security risk, so I decided to update. It is strange because "About ImageJ" reports version 1.53o and Java 17.0.5, is that really too old?

Regardless I decided to install from source to get the most up to date version. So I did the following:
sudo apt install maven # to get maven from my package manager
git clone https://github.com/imagej/ImageJ
cd ImageJ
mvn

Maven works for a while and then fails with the following error:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Source option 6 is no longer supported. Use 7 or later.
[ERROR] Target option 6 is no longer supported. Use 7 or later.
[INFO] 2 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  22.410 s
[INFO] Finished at: 2023-02-04T12:04:29-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (complete-recompile) on project ij: Compilation failure: Compilation failure: 
[ERROR] Source option 6 is no longer supported. Use 7 or later.
[ERROR] Target option 6 is no longer supported. Use 7 or later.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

This stackoverflow was helpful: https://stackoverflow.com/questions/61860989/another-maven-source-option-6-is-no-longer-supported-use-7-or-later

I changed this line in pom.xml:
<scijava.jvm.version>6</scijava.jvm.version>
to this:
<scijava.jvm.version>8</scijava.jvm.version>

Now maven successfully completes, and I can start FIJI as follows: java -jar target/ij-1.x-SNAPSHOT.jar. It reports version 1.54c7, Java 17.0.5. But now when I ask it to update, I am confronted with the choice to upgrade to v1.54b, daily build, previous, etc. All I really want to do is update my extensions. I am not sure if I am doing any of this right.

My questions:

  • What is the recommended way to install an up-to-date version of FIJI that will not have security risks and can also update its extensions?
  • Is it appropriate to make the Maven change from jvm v6 to v8 in pom.xml? I am not familiar with maven.
  • What version of jvm is required / recommended?

Thanks!

@cxrodgers
Copy link
Author

Actually I can resolve my immediate issue of running an up-to-date version simply by downloading the FIJI zipfile, unzipping, and running the binary. However, it would still be good to know how to install from source, and whether the version change in pom.xml I mentioned above is acceptable / recommended.

@rasband
Copy link
Member

rasband commented Feb 12, 2023

The ant makefile that builds the ij.jar file (https://imagej.net/ij/source/build.xml) uses source="1.6" target="1.6" because Fiji fails to launch with source="1.8" target="1.8".

@ctrueden
Copy link
Member

The relevant issue on the ImageJ2 side is imagej/ij1-patcher#53, which I would very much like to fix, but have not yet had time to work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants