2

Installed omegaT from the Software Centre (Ubuntu 12.04). When I try to start it, I just get the error message:

Suitable java binary not found.

The output of java -version is:

java version "1.7.0_55" Java(TM) SE Runtime Environment (build 1.7.0_55-b13) Java HotSpot(TM) Server VM (build 24.55-b03, mixed mode)

Anybody have any ideas?

Thanks

Peter

3

The fault is with the omegat shell script which tries to find out java version. The script is supposed to start the program only if it finds an openjdk or a sun java implementation on the machine. For this, it tries to look at the path where java is installed using below line:

JAVA=$(which java | xargs readlink -f)

Then checks whether the "path" contains the name openjdk or sun in it by

echo "$JAVA" | grep -q -e '\(openjdk\|sun\)'

Now, here's the problem. You may not always install java at a location having the name "sun" in it, as in my case it was at /usr/local/java/jdk1.7.0_07/bin/java.

So, the solution lies in simply correcting this script as you already HAVE the suitable java version installed.

Here's my working /usr/bin/omegat file.


#!/bin/sh

JAVA_OPTIONS='-Djava.library.path=/usr/lib/jni'

JAVA=$(which java | xargs readlink -f)

echo "$JAVA" | grep -q -e '\(openjdk\|sun\)'
#CHANGE 1, just use your java here.
JAVABIN=$JAVA
if [ $? -eq 0 ]
then
    JAVABIN=$JAVA
elif [ -x /usr/lib/jvm/java-6-openjdk/bin/java ]
then
    JAVABIN="/usr/lib/jvm/java-6-openjdk/bin/java"
elif [ -x /usr/lib/jvm/java-6-sun/bin/java ]
then
    JAVABIN="/usr/lib/jvm/java-6-sun/bin/java"
elif [ -x /usr/lib/jvm/java-1.5.0-sun/bin/java ]
then
    JAVABIN="/usr/lib/jvm/java-1.5.0-sun/bin/java"
else
    echo "Suitable java binary not found."
#CHANGE 1, comment out the exit line below.
   # exit 1
fi

exec $JAVABIN $JAVA_OPTIONS -jar /usr/share/omegat/OmegaT.jar $*

Notice the 2 "#CHANGE" lines in the script. Oh yes, you need to edit the file as root.

  • 1
    @user293817: It's encouraging to see pure users like you adopting Linux. Could you paste the output of these 2 commands separately? 1. which omegat 2. file /usr/bin/omegat You need to open the Terminal application and paste these comands 1 after other and press return to get the output. – Ashish Jul 29 '14 at 10:59
0

I have the same problem. I found this: http://markmail.org/message/hvfl2hhhaqjk243q but don't know what to do with it.

From the link: The solution is easy: in /usr/bin/omegat, the bash script tests java version and checks if it's openjdk or sun. Replace 'sun' by 'oracle' and it works. The author of the question has Oracle Java, not openjdk-6-jdk or openjdk-7-jdk, installed so this solution should also work for him.

  • 1
    Thanks, @Ashish, for the explanation. I still don't know where to find the script. My usr/bin/omegat file is the program itself. When I open it in the folder, I get a window titled PyPar2. I can either "check" or "create" but can't make anything of it... Sorry, I'm more of a user than an ubuntu expert. – user293817 Jul 28 '14 at 15:24
  • for finding the script and editing you need to open it in any text editors you find suitable: type sudo gedit /usr/bin/omegat then the script opens up in gedit ext editor – TechJhola Jan 24 '16 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.