imagej / ImageJ

Public domain software for processing and analyzing scientific images
http://imagej.org
Other
513 stars 218 forks source link

JVM version error with maven #198

Open cxrodgers opened 1 year ago

cxrodgers commented 1 year ago

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:

Thanks!

cxrodgers commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.