Good point. Can you try:

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

JAVA=java
JAVAC=javac

UNSET="No JAVA_HOME set, trying with java and javac executables from the path."
if [ ! -z $JAVA_HOME ]; then
    # test if it is a JDK
    if [ -e "$JAVA_HOME/bin/javac" ]; then
        echo "Using JDK from JAVA_HOME environmental variable: $JAVA_HOME"
        # JAVA_HOME is ok to be used
        JAVA=$JAVA_HOME/bin/java
        JAVAC=$JAVA_HOME/bin/javac
    else
        echo $UNSET
    fi
else
    echo $UNSET
fi
echo ""

CLASS="import javax.imageio.ImageIO; public class CheckGeotoolsJava {
public static void main( String[] args ) { for (String name :
ImageIO.getReaderFormatNames()) System.out.println(name); } }"
echo $CLASS > CheckGeotoolsJava.java
$JAVAC CheckGeotoolsJava.java
echo "Your current java installation supports the following image formats:"
$JAVA CheckGeotoolsJava
rm CheckGeotoolsJava.java
rm CheckGeotoolsJava.class

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


Ciao,
Andrea


On Thu, Jul 28, 2011 at 5:23 PM, Gabriel Roldan <[email protected]> wrote:
> works for me. It'd be nice though if the script checked whether
> there's a JAVA_HOME env variable set and then execute
> $JAVA_HOME/bin/java instead, for environments like mine where
> JAVA_HOME is set but the java command doesn't resolve to that one. In
> my case java resolves to openjdk and $JAVA_HOME/bin/java to
> Sun/Oracle's, and the list of supported formats is different (have Jai
> installed for Sun's JDK only)
>
> Cheers,
> Gabriel
>
> On Thu, Jul 28, 2011 at 5:54 AM, Ian Turton <[email protected]> wrote:
>> On 28 July 2011 08:49, andrea antonello <[email protected]> wrote:
>>>> for (String name : ImageIO.getReaderFormatNames()) 
>>>> System.out.println(name);
>>>
>>> Wunderbar!
>>>
>>> Somehting like:
>>>
>>> CLASS="import javax.imageio.ImageIO; public class CheckGeotoolsJava {
>>> public static void main( String[] args ) { for (String name :
>>> ImageIO.getReaderFormatNames()) System.out.println(name); } }"
>>> echo $CLASS > CheckGeotoolsJava.java
>>> javac CheckGeotoolsJava.java
>>> echo "Your current java installation supports the following image formats:"
>>> java CheckGeotoolsJava
>>> rm CheckGeotoolsJava.java
>>> rm CheckGeotoolsJava.class
>>
>> works for me on Linux (Ubuntu Natty).
>>
>> Ian
>>
>> ------------------------------------------------------------------------------
>> Got Input?   Slashdot Needs You.
>> Take our quick survey online.  Come on, we don't ask for help often.
>> Plus, you'll get a chance to win $100 to spend on ThinkGeek.
>> http://p.sf.net/sfu/slashdot-survey
>> _______________________________________________
>> Geotools-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>
>
>
>
> --
> Gabriel Roldan
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to