Bug 1440038

Summary: Freemind does not start: /home/USER/.freemind/auto.properties (No such file or directory)
Product: [Fedora] Fedora Reporter: Daniel Bristot de Oliveira <daolivei>
Component: freemindAssignee: Michael Simacek <msimacek>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 25CC: java-sig-commits, mizdebsk, msimacek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-11 14:51:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Bristot de Oliveira 2017-04-07 08:14:34 UTC
Description of problem:
After installing freemind, I tried to run it, resulting in the following error:

[bristot@t460s Desktop]$ freemind
Checking Java Version...
java.io.FileNotFoundException: /home/bristot/.freemind/auto.properties (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at freemind.main.FreeMindStarter.readUsersPreferences(FreeMindStarter.java:165)
	at freemind.main.FreeMindStarter.main(FreeMindStarter.java:60)
Panic! Error while loading default properties.
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at freemind.main.FreeMindStarter.main(FreeMindStarter.java:90)
Caused by: java.awt.HeadlessException
	at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
	at java.awt.Window.<init>(Window.java:536)
	at java.awt.Frame.<init>(Frame.java:420)
	at javax.swing.JFrame.<init>(JFrame.java:233)
	at freemind.main.FreeMind.<init>(FreeMind.java:275)
	at freemind.main.FreeMind.main(FreeMind.java:879)
	... 5 more
Exception in thread "main" java.awt.HeadlessException
	at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
	at java.awt.Window.<init>(Window.java:536)
	at java.awt.Frame.<init>(Frame.java:420)
	at java.awt.Frame.<init>(Frame.java:385)
	at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1758)
	at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1833)
	at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1696)
	at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863)
	at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:666)
	at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:637)
	at freemind.main.FreeMindStarter.main(FreeMindStarter.java:99)
ABRT problem creation: 'success'
[bristot@t460s Desktop]$ 


Version-Release number of selected component (if applicable):
[bristot@t460s Desktop]$ rpm -qa | grep freemind
freemind-minimal-1.0.1-14.fc25.noarch
freemind-script-1.0.1-14.fc25.noarch
freemind-map-1.0.1-14.fc25.noarch
freemind-collaboration-socket-1.0.1-14.fc25.noarch
freemind-svg-1.0.1-14.fc25.noarch
freemind-1.0.1-14.fc25.noarch
freemind-help-1.0.1-14.fc25.noarch


How reproducible:
Always

Steps to Reproduce:
1. install freemind
2. run it

Actual results:
Freemind is not starting

Expected results:
Freemind starting

Additional info:

Comment 1 Daniel Bristot de Oliveira 2017-04-07 08:21:11 UTC
.freemind directory:
  [bristot@t460s ~]$ ls -lR .freemind/
  .freemind/:
  total 0

Java information:
  [bristot@t460s ~]$ java -version
  openjdk version "1.8.0_121"
  OpenJDK Runtime Environment (build 1.8.0_121-b14)
  OpenJDK 64-Bit Server VM (build 25.121-b14, mixed mode)

Comment 2 Daniel Bristot de Oliveira 2017-04-07 08:28:07 UTC
It works with oracle's java:

---------------------- %< ---------------
[bristot@t460s ~]$ export JAVA_HOME=/usr/java/jdk1.8.0_111/
[bristot@t460s ~]$ export JAVACMD=/usr/java/jdk1.8.0_111/bin/java
[bristot@t460s ~]$ freemind
Checking Java Version...
java.io.FileNotFoundException: /home/bristot/.freemind/auto.properties (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at freemind.main.FreeMindStarter.readUsersPreferences(FreeMindStarter.java:165)
	at freemind.main.FreeMindStarter.main(FreeMindStarter.java:60)
Panic! Error while loading default properties.

STDOUT: User patterns file /home/bristot/.freemind/patterns.xml not found.
STDOUT: User patterns file /home/bristot/.freemind/patterns.xml not found.

(freemind opens)
---------------------- %< ---------------


Java information:

---------------------- %< ---------------
[bristot@t460s ~]$ /usr/java/jdk1.8.0_111/bin/java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
---------------------- %< ---------------

Comment 3 Michael Simacek 2017-04-07 09:54:49 UTC
From the exception it seems that your openjdk installation is headless. Headless installations cannot run graphical applications like freemind. freemind package has a hard requirement on java (full java, not headless), which should normally pull in full openjdk. In your case it seems, that the java requirement was satisfied by something else from a 3rd party repo. Can you post the output of:
dnf repoquery --installed --whatprovides java

Anyway, to make freemind run on openjdk, you need to install java-1.8.0-openjdk-headless.

Comment 4 Daniel Bristot de Oliveira 2017-04-07 16:20:02 UTC
- "Headless installations cannot run graphical applications like freemind." 

- "Anyway, to make freemind run on openjdk, you need to install java-1.8.0-openjdk-headless."

I did not understand. Do I need it or not?

Anyway, my openjdk installation is the default for Fedora, shouldn't the package/dnf take care of the dependencies?

These are java/jdk packages I have installed:

# rpm -qa | grep -E 'java|jdk'
python3-javapackages-4.7.0-6.1.fc25.noarch
copy-jdk-configs-2.2-2.fc25.noarch
tzdata-java-2017a-1.fc25.noarch
java-1.8.0-openjdk-headless-1.8.0.121-8.b14.fc25.x86_64
jdk1.8.0_111-1.8.0_111-fcs.x86_64
javapackages-tools-4.7.0-6.1.fc25.noarch
javahelp2-2.0.05-19.fc24.noarch
abrt-java-connector-1.1.0-8.fc24.x86_64


-- Daniel

Comment 5 Michael Simacek 2017-04-11 14:51:34 UTC
(In reply to Daniel Bristot de Oliveira from comment #4)
> - "Headless installations cannot run graphical applications like freemind." 
> 
> - "Anyway, to make freemind run on openjdk, you need to install
> java-1.8.0-openjdk-headless."
> 
> I did not understand. Do I need it or not?

Sorry, I made a mistake, you need to install java-1.8.0-openjdk.

> 
> Anyway, my openjdk installation is the default for Fedora, shouldn't the
> package/dnf take care of the dependencies?

Fedora allows installing multiple java runtimes and selecting which one is used for running applications. The problem is that these two steps are independent. Freemind requires full java (non-headless) to run and dnf makes sure that you have it installed (jdk1.8.0 provides java and is installed). But it has no way of knowing that a different java is selected for runtime (java-1.8.0-openjdk-headless) than the one it had installed (jdk1.8.0).

In default Fedora installation this doesn't happen, because Fedora repositories have only one java (openjdk). But because you installed a 3rd party jdk package jdk1.8.0_111-1.8.0_111-fcs.x86_64 this problem appears.

freemind's dependencies are declared correctly - there's nothing I can do about your problem from freemind side. Unfortunately, when you install a 3rd party JDK RPM, you need to take care of the consequences manually.

> 
> These are java/jdk packages I have installed:
> 
> # rpm -qa | grep -E 'java|jdk'
> python3-javapackages-4.7.0-6.1.fc25.noarch
> copy-jdk-configs-2.2-2.fc25.noarch
> tzdata-java-2017a-1.fc25.noarch
> java-1.8.0-openjdk-headless-1.8.0.121-8.b14.fc25.x86_64
> jdk1.8.0_111-1.8.0_111-fcs.x86_64
> javapackages-tools-4.7.0-6.1.fc25.noarch
> javahelp2-2.0.05-19.fc24.noarch
> abrt-java-connector-1.1.0-8.fc24.x86_64
> 
> 
> -- Daniel

Comment 6 Daniel Bristot de Oliveira 2017-04-13 10:07:18 UTC
> freemind's dependencies are declared correctly - there's nothing I can do
> about your problem from freemind side. Unfortunately, when you install a 3rd
> party JDK RPM, you need to take care of the consequences manually.

Nice, makes me recall the old days, using slackware, in the early 2000's.