Hello
 
I tried to start /usr/bin/freemind but it could not find a java:
  /usr/bin/freemind: Unable to find an appropriate java runtime. See 
java_wrappers(7) for help

 
The reason is th usage of '$__jvm_alt' in java-wrappers.sh 
which is delivered by  jvm-list.sh:59

I think that an empty string in  '$__jvm_alt' is handed wrong in 
java-wrappers.sh:125
Additionaly the variable shouldn't be empty.

in  jvm-list.sh:59
__jvm_alt=$(readlink /etc/alternatives/java|sed -n 
's/\(\/usr\/lib\/jvm\/[^\/]*\)\/.*/\1/p')
 
> readlink /etc/alternatives/java
 /opt/Oracle_Java/jre1.8.0_45/bin/java
 
>__jvm_alt=$(readlink /etc/alternatives/java|sed -n 
>'s/\(\/usr\/lib\/jvm\/[^\/]*\)\/.*/\1/p'); echo $__jvm_alt
here we get an empty string  
>
  
 
Without option -n in the sed command everything works well
 
> __jvm_alt=$(readlink /etc/alternatives/java|sed  
> 's/\(\/usr\/lib\/jvm\/[^\/]*\)\/.*/\1/p');echo $__jvm_alt
 /opt/Oracle_Java/jre1.8.0_45/bin/java
>
  
why  do we need this sed-expression and why the option -n ?
 

thus

 
 
trace of  /usr/bin/freemind, java-wrappers.sh, jvm-list.sh
---------
> DEBUG=script DEBUG_WRAPPER=1 /usr/bin/freemind
 + [ -n script ]
+ DEBUG_WRAPPER=1
+ export DEBUG_WRAPPER
+ _source /etc/freemind/freemindrc
+ [ -f /etc/freemind/freemindrc ]
+ _source /home/thus/.freemind/freemindrc
+ [ -f /home/thus/.freemind/freemindrc ]
+ [ -r /usr/lib/java-wrappers/java-wrappers.sh ]
+ . /usr/lib/java-wrappers/java-wrappers.sh
+ . /usr/lib/java-wrappers/jvm-list.sh
+ dpkg --print-architecture
+ __arch=i386
+ __jvm_default=/usr/lib/jvm/default-java
+ __jvm_sun6=/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun
+ __jvm_sun=/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun
+ __jvm_sunmin5=/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun
+ __jvm_gcj2=/usr/lib/jvm/java-*-gcj-4.* 
+ __jvm_gcj5=/usr/lib/jvm/java-1.5*-gcj-4.* 
+ __jvm_openjdk6=/usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk
+ __jvm_openjdk7=/usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-7-openjdk
+ __jvm_gcj=/usr/lib/jvm/java-*-gcj-4.* 
+ __jvm_openjdk=/usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-7-openjdk 
/usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk
+ __jvm_java7=/usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-7-openjdk
+ __jvm_java6=/usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk 
/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun /usr/lib/jvm/java-7-openjdk-i386 
/usr/lib/jvm/java-7-openjdk
+ __jvm_java5=/usr/lib/jvm/java-1.5*-gcj-4.*  /usr/lib/jvm/java-6-openjdk-i386 
/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun 
/usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-7-openjdk
+ __jvm_java2=/usr/lib/jvm/java-1.5*-gcj-4.*  /usr/lib/jvm/java-6-openjdk-i386 
/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun 
/usr/lib/jvm/java-7-openjdk-i386 /usr/lib/jvm/java-7-openjdk 
/usr/lib/jvm/java-*-gcj-4.* 
+ readlink /etc/alternatives/java
+ sed -n s/\(\/usr\/lib\/jvm\/[^\/]*\)\/.*/\1/p


This value is wrong (empty string) an it is handled wrong later
+ __jvm_alt= 


+ __jvm_all=/usr/lib/jvm/default-java /usr/lib/jvm/*
+ [  ]
+ JAVA_CLASSPATH=
+ [  ]
+ DESTDIR=
+ [  ]
+ JAVA_JARPATH=/usr/share/java
+ [  ]
+ require_java_runtime java6
+ find_java_runtime java6
+ [  ]
+ [  ]
+ [ -z  ]
+ DIRS=
+ test -z java6
+ test java6
+ echo java6
+ egrep -- [^0-9A-Za-z_]
+ eval echo -n $__jvm_java6
+ echo -n /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk 
/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun /usr/lib/jvm/java-7-openjdk-i386 
/usr/lib/jvm/java-7-openjdk
+ found_jvm=/usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk 
/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun /usr/lib/jvm/java-7-openjdk-i386 
/usr/lib/jvm/java-7-openjdk
+ [ -z /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk 
/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun /usr/lib/jvm/java-7-openjdk-i386 
/usr/lib/jvm/java-7-openjdk ]
+ DIRS= /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk 
/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun /usr/lib/jvm/java-7-openjdk-i386 
/usr/lib/jvm/java-7-openjdk
+ shift
+ test 
+ [ -z  /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk 
/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun /usr/lib/jvm/java-7-openjdk-i386 
/usr/lib/jvm/java-7-openjdk ]
+ echo  /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/java-6-openjdk 
/usr/lib/jvm/java-6-sun /usr/lib/j2*1.6-sun /usr/lib/jvm/java-7-openjdk-i386 
/usr/lib/jvm/java-7-openjdk
+ fgrep 
+ JAVA_HOME=
+ java_debug Picking up the JVM designated by the alternatives system: 
+ [ 1 ]
+ echo [debug] /usr/bin/freemind: Picking up the JVM designated by the 
alternatives system: 
[debug] /usr/bin/freemind: Picking up the JVM designated by the alternatives 
system: 
+ java_debug   JAVA_HOME = ''
+ [ 1 ]
+ echo [debug] /usr/bin/freemind:   JAVA_HOME = ''
[debug] /usr/bin/freemind:   JAVA_HOME = ''
+ [  ]
+ java_warning No java runtime was found
+ echo [warning] /usr/bin/freemind: No java runtime was found
[warning] /usr/bin/freemind: No java runtime was found
+ return 1
+ java_fail Unable to find an appropriate java runtime. See java_wrappers(7) 
for help
+ echo [error] /usr/bin/freemind: Unable to find an appropriate java runtime. 
See java_wrappers(7) for help
[error] /usr/bin/freemind: Unable to find an appropriate java runtime. See 
java_wrappers(7) for help
+ exit 1
 

Reply via email to