Discussion:
[Jxplorer-users] jxplorer.sh fails
Richard Gomes
2010-10-20 02:50:29 UTC
Permalink
Hi guys,

I've recently downloaded JXplorer and I found two issues in script
jxplorer.sh and I also found another potential issue.


1st issue:

When running jxplorer.sh from any directory (except from the
installation directory) or when there are symlinks, the script may fails
if an user HAS a valid Java environment defined.

The solution is easy: We only need to move these lines...

basename=`basename $0`
dirname=`dirname $0`
cd ${dirname}
dirname=`pwd`

... to the top, which means that $dirname will always contain the actual
directory where jxplorer.sh is sitting on, regardless of the location
where it is launched, regardless presence of symlinks or not, regardless
a valid Java environment defined or not.


2nd issue:

JAVAV must be defined relative to $OPTJX and not the relative to the
arbitrary location "/opt/jxplorer".

#wrong: JAVAV=/opt/jxplorer/jre/bin/java
JAVAV=${OPTJX}/jre/bin/java


Potential issue:

When an user DOES NOT have a Java environment defined, jxplorer.sh
provides one, which is a relative directory called jre.
Well... I've downloaded the zipped Java distribution (not a pre-packaged
distribution to my environment) and there's no "jre" directory in there!
which means that jxplorer.sh will fail anyway when an user does not have
a Java environment configured.

In fact... it does not make sense to distribute a jre directory because
we don't know which architecture is need... x86? PowerPC? ARM? 32bits?
64bits? whatever?

So, in this case, jxplorer.sh should simply provide a message and quit.

Please find attached the jxplorer.sh file I changed in order to address
all these issues I mentioned above. I've tested in order to simulate an
user which HAS a valid Java environment defined and also when no Java
environment is defined. I removed unused code which would only pollute
the script instead of provide any useful history information of changes.

I hope it helps.


Cheers :)
--
Richard Gomes
M: +44(77)9955-6813
http://tinyurl.com/frgomes
twitter: frgomes

JQuantLib is a library for Quantitative Finance written in Java.
http://www.jquantlib.org/
twitter: jquantlib
Douglas E. Engert
2010-10-20 14:26:08 UTC
Permalink
What version of Jxplorer are you using? It is from the svn?

Do you have a diff file of your changes?
Post by Richard Gomes
Hi guys,
I've recently downloaded JXplorer and I found two issues in script jxplorer.sh and I also found another potential issue.
When running jxplorer.sh from any directory (except from the installation directory) or when there are symlinks, the script may fails if an user HAS a valid Java environment defined.
The solution is easy: We only need to move these lines...
basename=`basename $0`
dirname=`dirname $0`
cd ${dirname}
dirname=`pwd`
... to the top, which means that $dirname will always contain the actual directory where jxplorer.sh is sitting on, regardless of the location where it is launched, regardless presence of symlinks or
not, regardless a valid Java environment defined or not.
JAVAV must be defined relative to $OPTJX and not the relative to the arbitrary location "/opt/jxplorer".
#wrong: JAVAV=/opt/jxplorer/jre/bin/java
JAVAV=${OPTJX}/jre/bin/java
When an user DOES NOT have a Java environment defined, jxplorer.sh provides one, which is a relative directory called jre.
Well... I've downloaded the zipped Java distribution (not a pre-packaged distribution to my environment) and there's no "jre" directory in there! which means that jxplorer.sh will fail anyway when an
user does not have a Java environment configured.
In fact... it does not make sense to distribute a jre directory because we don't know which architecture is need... x86? PowerPC? ARM? 32bits? 64bits? whatever?
So, in this case, jxplorer.sh should simply provide a message and quit.
Please find attached the jxplorer.sh file I changed in order to address all these issues I mentioned above. I've tested in order to simulate an user which HAS a valid Java environment defined and also
when no Java environment is defined. I removed unused code which would only pollute the script instead of provide any useful history information of changes.
I hope it helps.
Cheers :)
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Jxplorer-users mailing list
https://lists.sourceforge.net/lists/listinfo/jxplorer-users
--
Douglas E. Engert <***@anl.gov>
Argonne National Laboratory
9700 South Cass Avenue
Argonne, Illinois 60439
(630) 252-5444
Loading...