No java runtime found

Bug #908679 reported by Jonathan Lange on 2011-12-26
54
This bug affects 12 people
Affects Status Importance Assigned to Milestone
java-wrappers (Ubuntu)
High
Unassigned

Bug Description

When I try to run freemind with precise, I get this error:

$ freemind
[warning] /usr/bin/freemind: No java runtime was found
[error] /usr/bin/freemind: Unable to find an appropriate java runtime. See java_wrappers(7) for help

In addition:

$ man 7 java_wrappers
No manual entry for java_wrappers in section 7

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: freemind 0.9.0+dfsg-1
ProcVersionSignature: Ubuntu 3.2.0-6.12-generic 3.2.0-rc6
Uname: Linux 3.2.0-6-generic x86_64
ApportVersion: 1.90-0ubuntu1
Architecture: amd64
Date: Mon Dec 26 17:02:17 2011
EcryptfsInUse: Yes
PackageArchitecture: all
SourcePackage: freemind
UpgradeStatus: Upgraded to precise on 2011-12-15 (10 days ago)

Jonathan Lange (jml) wrote :
Changed in freemind (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Colin Watson (cjwatson) on 2012-01-03
affects: freemind (Ubuntu) → java-wrappers (Ubuntu)
Matthias Klose (doko) wrote :

unable to reproduce, on a headless system I get:

Checking Java Version...
java.io.FileNotFoundException: /home/doko/.freemind/auto.properties (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:137)
        at freemind.main.FreeMindStarter.readUsersPreferences(FreeMindStarter.java:136)
        at freemind.main.FreeMindStarter.main(FreeMindStarter.java:56)
Panic! Error while loading default properties.
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at freemind.main.FreeMindStarter.main(FreeMindStarter.java:63)
Caused by: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
        at java.awt.Window.<init>(Window.java:476)
        at java.awt.Frame.<init>(Frame.java:419)
        at javax.swing.JFrame.<init>(JFrame.java:218)
        at freemind.main.FreeMind.<init>(FreeMind.java:201)
        at freemind.main.FreeMind.main(FreeMind.java:705)
        ... 5 more
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
        at java.awt.Window.<init>(Window.java:476)
        at java.awt.Frame.<init>(Frame.java:419)
        at java.awt.Frame.<init>(Frame.java:384)
        at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1754)
        at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1831)
        at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1692)
        at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:864)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:668)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:639)
        at freemind.main.FreeMindStarter.main(FreeMindStarter.java:67)

Changed in java-wrappers (Ubuntu):
status: New → Incomplete
Brian Murray (brian-murray) wrote :

After installing freemind I was able to recreate this:

bdmurray@artemis:~$ DEBUG_WRAPPER=1 freemind
[debug] /usr/bin/freemind: Picking up the JVM designated by the alternatives system:
[debug] /usr/bin/freemind: JAVA_HOME = '/usr/lib/jvm/java-6-openjdk'
[debug] /usr/bin/freemind: Found JAVA_HOME = '/usr/lib/jvm/java-6-openjdk'
[debug] /usr/bin/freemind: Found JAVA_CMD = '/usr/lib/jvm/java-6-openjdk/bin/java'
/usr/bin/freemind: 228: /usr/bin/freemind: /usr/lib/jvm/java-6-openjdk/bin/java: not found

This also happened with ant:

bdmurray@artemis:~$ ant
Error: JAVA_HOME is not defined correctly.
  We cannot execute java

I found java in the following the directory on my system:

/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/

Steve Langasek (vorlon) on 2012-01-03
Changed in java-wrappers (Ubuntu):
status: Incomplete → Triaged
importance: Undecided → High
Changed in java-wrappers (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → nobody

I had the same problem:
$ freemind
[warning] /usr/bin/freemind: No java runtime was found
[error] /usr/bin/freemind: Unable to find an appropriate java runtime. See java_wrappers(7) for help

It turned out, that $JAVA_HOME was not set.

For my Java-Installation (Sun), the following command worked to set the $JAVA_HOME variable:

$ JAVA_HOME=/opt/java/32/jre1.6.0_30/
$ export JAVA_HOME

To make this setting static, you might use the following command:

$ sudo bash -c "echo JAVA_HOME=/opt/java/32/jre1.6.0_30/ >> /etc/environment"

This problem also affects freeplane - another java-based mindmapping tool - on oneiric ocelot. Workaround is to prepend JAVA_HOME=/usr, so the command line reads JAVA_HOME=/usr freeplane

Re the man page not working: the package is called java-wrappers, not java_wrappers, so man java-wrappers works.

Environment
ubuntu 11.10 3.0.0-23-generic

Java(TM) SE Runtime Environment (build pxi3260sr10fp1-20120321_01(SR10 FP1))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr10fp1-20120202_101568 (JIT enabled, AOT enabled)
J9VM - 20120202_101568
JIT - r9_20111107_21307ifx1
GC - 20120202_AA)
JCL - 20120320_01

DiegoV (diegofcviegas) wrote :

Solved this with declare -x JAVA_CMD="/usr/bin/java" .

John Franklin (hondaman-nc) wrote :

Solved this by adding

     JAVA_CMD=/usr/bin/java

just about the line

     findjava() {

around line number 39 in /usr/bin/freeplane

MankyGitt (dnadruff) wrote :

For Freemind:
I solved this as follows:

ENVIRONMENT: Ubuntu 12.04.3 (clean installation)
java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

Freemind installed via the Ubuntu Software Centre - the supported package.

in the terminal:
$ sudo nano /usr/bin/freemind

in the section:
#--------- Put the environment together --------------------------------
replace the reference to java-wrappers.sh as follows: (I have commented out the original line (x2) and followed with the correct path for this installation environment.
# if [ -r /usr/lib/java-wrappers/java-wrappers.sh ]
if [ -r /usr/lib/java-wrappers.sh ]
then # the Debian method
# . /usr/lib/java-wrappers/java-wrappers.sh
       . /usr/lib/java-wrappers.sh
        require_java_runtime java6
else
        findjava
        if [ $? -ne 0 ]
        then
                exit 1
        fi
fi
--------------end of sample --------------

It appears that the location of java-wrappers.sh has changed in more recent releases.

Freemind now launches as intended.
The same fix will resolve the freeplane issue.
The other way to solve this (but I think it is messy) is to create the path
/usr/lib/java-wrappers/
and place a symbolic link to /usr/lib/java-wrappers.sh into this directory.

This would perhaps address issues if you have multiple applications that look for the old path.

MankyGitt (dnadruff) wrote :

This is not a duplicate of bug report 887077

This issue is specifically about older applications (freemind and freeplane) that require updates to support current deployment practices for current Java runtime environments.

bug 887077 is about a problem resolving alternative Java Virtual environments where multiple JVM deployments are present, and where the user desires to select different JVMs for different application purposes.

Thierry Benita (tbenita-p) wrote :

resolved by creating the file /etc/profile.d/java.sh
with the content :
export JAVA_CMD=/usr/bin/java

Raheel (raheelchaudhry) wrote :

This thread solved my problem with freeplane not finding java. Specifically the command 'sudo dpkg --configure -a' fixed my stalled installed of java7 and 'DEBUG_WRAPPER=1 freeplane' made it possible for me to see what was missing. I'm not an expert on Linux so this is all the information I can provide.

Michael Kuefner (herrminni) wrote :

If anyone has the Problem in Ubuntu 15.04 with the newest Oracle Java 8, I found the problem in java-wrappers file which determines the available Java installations:

In file "/usr/lib/java-wrappers/jvm-list.sh":

=> added "/usr/lib/jvm/java-8-oracle" on line 35
__jvm_oracle8="/usr/lib/jvm/java-8-oracle /usr/lib/jvm/jdk-8-oracle-* /usr/lib/jvm/jre-8-oracle-*"

As the current installation of Oracle 8 Java is installed in this added path.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers