Before writing JavaScript small programs in Linux, you have to check the Java version used by ImageJ because of a bug with the latest Java packages...
In Linux, there are two different packages:
- An open-source version: OpenJDK
- A proprietary: Oracle's Java.
Note: When you read these lines, I am using ImageJ version 1.50f with Ubuntu 14.04 LTS. This bug might be solved in more recent updates.
1. Configuration of Java
If you have downloaded in the ImageJ website, ImageJ + Java 1.6 or ImageJ + Java 1.8, there is no problem because these distributions are packaged with an Oracle's Java Runtime Environment (jre). However, if you just download the Platform Independent package of ImageJ to save space on your hard disk, you have to checked your pre-installed Java version.1.1. How to check my Java version in ImageJ?
Run ImageJ and go toPlugins > Utilities > ImageJ Properties
to open a popup window entitled Properties (Fig. 1)...Now, look at the first line java.version and java.vm.name to get the version and Java distribution.
1.2. How to check my Java version in a shell?
Open a shell (or terminal) and type the following command:java -version
If you have an OpenJDK, this kind of message is displayed:
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
... or this one if you have an Oracle's (HotSpot) ...
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
1.3. How to check my Java version in JavaScript
If you know how to write a script in ImageJ, just run these two lines:
IJ.log(System.getProperty("java.version"));
IJ.log(System.getProperty("java.vm.name"));
Hope that helps!!
No comments:
Post a Comment