You are not logged in.

#1 2008-11-21 08:36:03

sverzijl
Member
Registered: 2008-11-21
Posts: 5

Freemind won't run after install, can't find Java

Hi,

I attempted to install freemind using the following command:

pacman -S freemind

It installed along with the relevant Java dependency.

When I try to run freemind I get the following error:

which: no java in (/bin:/usr/bin:/sbin:/usr/sbin:/opt/kde/bin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core:/opt/qt/bin)
ERROR:   Couldn't find a java virtual machine,
         define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH.

When I attempt to run 'freemind.jar' via java itself using the following command:

/opt/java/jre/bin/java freemind.jar

I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: freemind/jar
Caused by: java.lang.ClassNotFoundException: freemind.jar              
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)      
        at java.security.AccessController.doPrivileged(Native Method)  
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)  
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)       
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)        
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: freemind.jar.  Program will exit.

Any help would be much appreciated

Offline

#2 2008-11-21 21:02:14

cybermage
Member
From: Czech Republic
Registered: 2008-11-19
Posts: 12

Re: Freemind won't run after install, can't find Java

I can run Freemind - no problem. I have (previously) installed Java using jdk package
There are two possible problems:

1) Program's execute file is /usr/share/freemind/freemind.sh - it's shell script, so you will have to run it from terminal using command
bash /usr/share/freemind/freemind.sh (it's how I ran it)
Remember - you can't (usually) run Java programs from *.jar files, because Java has to have declared some variables first (that's what that shell script  is for - Windows are using their typical exe files for running Java programs )

2) You don't have correct Java. There are two types of Java: opensource (openjdk) and "original" Java from Sun. openjdk is (fully) opensource, but lacks some of Sun's Java features, but because it's opensource, it's generally favourized (hope that it's the correct word) in Linux and Java-dependent packages in Arch usually installs that.
Try uninstall both Freemind and whatever Java you are using now and install first java from Sun (packages jre and jdk, jdk is mostly for Java developers and should not be needed to run programs) and then install Freemind.

Edit: It's possible that you will need to restart computer after installing Java (but probably not)

Last edited by cybermage (2008-11-21 21:04:47)

Offline

#3 2008-11-21 21:16:46

sverzijl
Member
Registered: 2008-11-21
Posts: 5

Re: Freemind won't run after install, can't find Java

The jre package was one of the dependents of Freemind.

Running:

sudo pacman -S jre

Ends up asking me if I want to reinstall?

---------------------------------------------------------------------------------------------------------

It seems that the latest version of jre doesn't install properly! I made a link for /opt/java/jre/bin/java in /usr/bin and Freemind works fine!

Is this a bug in the jre package? I'm new to Arch, are packages meant to just work? Or is some sort of user configuration necessary?

Offline

#4 2008-11-21 21:40:40

cybermage
Member
From: Czech Republic
Registered: 2008-11-19
Posts: 12

Re: Freemind won't run after install, can't find Java

Weird - I have no /usr/bin/java file in my Arch (i686) and Java runs just fine (but I have installed JDK), so I wouldn't say it's a bug in Java, it's just... weird (perhaps bug in KDE ? - I'm using Xfce)
Packages in Arch works, but bugs are more often to be found (it's a pay-off for having newer versions of programs than most other distros), especially in community repository.

Offline

#5 2008-11-21 22:15:55

sverzijl
Member
Registered: 2008-11-21
Posts: 5

Re: Freemind won't run after install, can't find Java

Ah okay, so I made the link in the right location then smile

I guess this is a sufficient fix then.

Thanks for the help!

Offline

#6 2008-11-21 22:34:22

Garns
Member
Registered: 2008-05-28
Posts: 239

Re: Freemind won't run after install, can't find Java

This is not a bug. When you install something to /opt the PATH variable won't be actualised automatically until the next time you login. So you can either log out and back in or source /etc/profile. Otherwise the shell won't know, the path of the program you just installed.

Offline

#7 2008-11-22 03:00:16

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Freemind won't run after install, can't find Java

Garns wrote:

This is not a bug. When you install something to /opt the PATH variable won't be actualised automatically until the next time you login. So you can either log out and back in or source /etc/profile. Otherwise the shell won't know, the path of the program you just installed.

Exactly.

Offline

#8 2008-11-22 12:21:10

cybermage
Member
From: Czech Republic
Registered: 2008-11-19
Posts: 12

Re: Freemind won't run after install, can't find Java

So that restart would help after all...

Offline

Board footer

Powered by FluxBB