CPA unable to find Java Runtime Environment

My Problem: Attempting to run “ImageViewer” apparently renders CPA unable to find java runtime environment, even though it is installed.
My Question: How can I tell CPA where to find my java-folder?

(On a potentionally related note, when running CellProfiler I am always prompted with the information “Plugin directory doesn’t point to valid folder: C:\CellProfiler\plugins Version: 2014-01-24T15:16:45 0c7b94 / 20140124151645” - And indeed, under this path there is no plugin-folder. Howerver, there is an empty “plugin”-folder ‘hidden’ in a still zipped "library-folder: C:\Program Files\CellProfiler\library.zip\cellprofiler\modules\plugins)

Thank you for your help,
I just read about the NIH-funding;
good job! :smiley:

Here are some specs which might help to pinpoint the problem:

================================================================
OS: WIN 7 amd64
CP: 2.1.0 (rev 0c7fb94) - 64bit Version
CPA: 2.0 (r11710)
JRE: JAVA_VERSION=“1.7.0”

What it says in the command-line interface of CPA, when I try to run the “ImageViewer”:

================================================================
both_Per_Object.ImageNumber
[MainThread] SELECT both_Per_Image.ImageNumber FROM both_Per_Image
Failed to find registry entry: SOFTWARE\JavaSoft\Java Runtime Environment
Traceback (most recent call last):
File “cellprofiler\utilities\setup.pyc”, line 139, in find_javahome
WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden

And a message pops up with the following content:

================================================================
“CellProfiler can’t find Java on your computer. CellProfiler can process images without Java, but uses the Bioformats Java library to process images if Java is available. …]”

followed by

================================================================
An error occurred in the program:
IOError: Can’t find jvm directory

Traceback (most recent call last):
File “cpa.py”, line 287, in launch_image_viewer
File “imageviewer.pyc”, line 227, in init
File “imageviewer.pyc”, line 675, in OnOpenImage
File “imagetools.pyc”, line 50, in FetchImage
File “imagereader.pyc”, line 15, in init
File “bioformats_init_.pyc”, line 20, in
File “cellprofiler\utilities\jutil.pyc”, line 161, in

================================================================

[quote=“YellowRibbon”]My Problem: Attempting to run “ImageViewer” apparently renders CPA unable to find java runtime environment, even though it is installed.
My Question: How can I tell CPA where to find my java-folder?[/quote]

The most straightforward way to do this is to set the system environment variable JAVAHOME; see here for how to do this: confluence.atlassian.com/displa … in+Windows (follow the Stage 1 instructions and Stage 2 steps 1-8).

On this issue, we’ve noted it as a bug here: github.com/CellProfiler/CellProfiler/issues/802. The fix is part of the upcoming patch release.

Regards,
-Mark

Awsome, I thank you very much! So my error wasn’t even caused by CellProfiler but rather by some faulty system directory on my side. (I am surprised, that installing java doesn’t automatically set up this system variable.)

Once I got this working, I tried using the CPA Classifiyer and noticed that fetching images would result in another error “UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe4 in position 2565: ordinal not in range(128)” … however, in combination with your earlier post http://forum.image.sc/t/cellprofiler-2-0-faq/12699/1#p6493 I found out that this error was only caused by the attempts of “CellProfiler Analyst” to start the 64-bit Java version instead of the 32-bit version. Which is why -using your link- I changed my JAVA_HOME pointing to the 32-bit java version. And now it works.

Now, I am diving head first into all these classifier-possibilities CPA has to offer :smiley: