imagej / ImageJ

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

ImageJ not working with newest JDK on PC, unrecognized option -Xincgc #163

Closed creynolds11 closed 2 years ago

creynolds11 commented 2 years ago

I am running the 64bit version of ImageJ and will not run with the newest version of jdk. When I run the imageJ updater it says that I don't have the most current version of java installed. I have tried multiple suggestions on how to correct this and nothing has worked. It fails to recognized the option -Xincgc and I don't know how to fix that. Are there any suggestions on how to fix this?

Here are the most common suggestions that I have tried that haven't worked.

I have uninstalled and reinstalled fresh versions multiple times. Since I am using a PC I made sure that I am extracting the FIJI.app folder to my Documents and not in the Program_files directory.

I have done all of the steps listed in the https://imagej.nih.gov/ij/docs/install/windows.html which are included below: Upgrading to a Newer Version of Java This is what you need to do to upgrade to a newer version of Java: Download and install the latest JDK from [www.oracle.com/technetwork/java/javase/downloads/] (http://www.oracle.com/technetwork/java/javase/downloads/) Go to the ImageJ folder and delete or rename the jre folder Delete the ImageJ.cfg file Restart ImageJ and the launcher (ImageJ.exe) will generate a new ImageJ.cfg that uses the Java you just installed.

The first issue was the imagej.cfg file is not created automatically when running imagej. The only way I could get the file to be generated was by going into Edit/Options/Memory & Threads and checking the memory allocation. Which my memory allocation is set as 24257MB so that isn't an issue as some posts have mentioned.

If I follow those steps and rename the Fiji.app/java folder to something like java.disabled and delete the imagej.cfg file, imageJ will not execute. It could not create java virtual machine.

I have installed the newest Java JDK and CUDA.

I have changed environmental paths adding JAVA_HOME pointing to the newest version of java/JDK, and set up a variable in my path, %JAVA_HOME%, that points to the bin fold in JDK. Imagej will not start with the same error of could not create java virtual machine.

I also tried copying the JDK folder directly into the Fiji.app/java folder replacing the jre folder and same issue.

I included the output of the debug.exe It correctly find the java but fails to recognize the -Xincgc

imagejjdebug

ctrueden commented 2 years ago

@creynolds11 Thanks for the report, but I'm confused. Are you using the original ImageJ, or Fiji? I ask because you mention the ImageJ Updater, which is part of ImageJ2 (and therefore Fiji), but not part of the original ImageJ. But then you link to some documentation on the original ImageJ website, rather than that of the ImageJ wiki which is more comprehensive of the different flavors of ImageJ.

If you are using Fiji: please download a fresh Fiji from https://fiji.sc/#download, which will come with a new-enough version of Java. Note that Fiji does not yet officially support Java 17 or 18; there are known issues. Please stick with Java 8 ideally for the time being, or Java 11 should also work. If you download a platform-specific Fiji though, you won't have to install Java yourself; that would only be needed if you use the "no-JRE" version of Fiji. See also How do I launch ImageJ with a different version of Java?.

creynolds11 commented 2 years ago

I was using the new Fiji this error impacted the ability to install and run an image stitching plug-in but I found that the error is a proxy issue with my work not with Fiji. So I closed this thread

ctrueden commented 2 years ago

@creynolds11 Glad you got it figured out!