Changeset 25211

Show
Ignore:
Timestamp:
12.03.2012 21:18:11 (8 years ago)
Author:
ak19
Message:

Correction to the test for java (now calling java -version, not just java) so that JDK 1.7 also returns the same result for the positive test as JDK 1.6.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/pdf-box/trunk/java/perllib/plugins/PDFBoxConverter.pm

    r24762 r25211  
    5959    } 
    6060    else { 
    61         # test to see if java is in path      
    62         my $cmd = "java"; 
     61        # test to see if java is in path 
     62        # Need to run java -version instead of just java, since the %ERRORLEVEL% returned 
     63        # for `java` (which is checked below for failure of the command) is 0 for JDK 1.6* 
     64        # while %ERRORLEVEL% is 1 for JDK 1.7* 
     65        # If `java -version` is run however, %ERRORLEVEL% returned is 0 if java is  
     66        # installed, regardless of whether the JDK version is 1.6* or 1.7*. 
     67        my $cmd = "java -version"; 
    6368        if ($ENV{'GSDLOS'} =~ /^windows/i) { 
    6469        $cmd .= " >nul 2>&1"; # java 2>&1 >null or java >null 2>&1 both work (%ERRORLEVEL% is 0)