Posted by
Stefan Heim on
Sep 15, 2008; 1:30pm
URL: http://imagej.273.s1.nabble.com/Linux-download-tp3695105p3695110.html
Hi Paolo,
On Fri, 2008-09-12 at 15:41 +0200, Paolo Ariano wrote:
> Il giorno ven, 12/09/2008 alle 11.47 +0200, Jarek Lipski ha scritto:
> > #!/bin/sh
> > SCRIPT_DIR=`dirname $0`
> > java -Xmx512m -jar $SCRIPT_DIR/ij.jar
>
> you could download the .deb from:
>
http://packages.debian.org/unstable/science/imagej>
> and if you want extract the imagej.sh wrapper or better i paste it
> here ;)
thanks for maintaining the ImageJ Debian package. The run script seems
to be a modified version of the file script.txt distributed with ImageJ
(or vice versa?), and suffers from the same error on 32 bit linux
architectures: it does not allow to change the size of the JVM heap.
Making use of the -x switch of the run script will trigger the following
error:
sheim@stardust:~$ imagej -x 1500
/usr/bin/imagej: line 263: ((: 1500 < 16 || 1500 > : syntax error: operand expected (error token is " ")
This is due to the variable max_mem being left unassigned on 32 bit
architectures. This patch:
--- imagej.orig 2008-07-11 11:24:15.000000000 +0200
+++ imagej 2008-07-11 11:24:17.000000000 +0200
@@ -102,7 +102,7 @@
else
arch='-d32'
java_path="${ij_path}/jre/bin/java"
- free_mem=`free | awk 'NR == 2 {fmem=int($2 / 1024); if (fmem < 1800) {print fmem} else {print 1800}}'`
+ max_mem=`free | awk 'NR == 2 {fmem=int($2 / 1024); if (fmem < 1800) {print fmem} else {print 1800}}'`
free_mem=`free | awk 'NR == 3 {fmem=int($4 / 1024); if (fmem < 1800) {print fmem} else {print 1800}}'`
mem=${free_mem}/3*2
if (( $mem > $default_mem || $mem < $min_mem )) ; then mem=$default_mem ; fi
fixes that issue. I had already filed a bug report for the Debian
package (
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=496798 ), but
got no response so far, so I'm reposting this here, because I think this
sould also be fixed in the script.txt distributed with ImageJ.
Thanks for your work,
-Stefan