Ignore:
Timestamp:
2012-05-01T15:53:54+12:00 (12 years ago)
Author:
ak19
Message:

Correction to previous commit: could not call a subroutine from a BEGIN block (in this case, could not call the new get_java_command() subroutine). But as subroutines in other files that are included can be called from BEGIN, I've added get_java_command as a utility function in GS' perllib/util.pm and this now gets called instead.

File:
1 edited

Legend:

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

    r25511 r25513  
    6666        # If `java -version` is run however, %ERRORLEVEL% returned is 0 if java is
    6767        # installed, regardless of whether the JDK version is 1.6* or 1.7*.
    68         my $java = &get_java_command();     
     68        my $java = &util::get_java_command();
     69           
    6970        my $cmd = "$java -version";
    7071        if ($ENV{'GSDLOS'} =~ /^windows/i) {
     
    122123    my $gextpb_home = $ENV{'GEXT_PDFBOX'};
    123124    my $pbajar = &util::filename_cat($gextpb_home,"lib","java","pdfbox-app.jar");
    124     my $java = &get_java_command();
     125    my $java = &util::get_java_command();
    125126    my $launch_cmd = "$java -cp \"$pbajar\" -Dline.separator=\"<br />\" org.apache.pdfbox.ExtractText";
    126127   
     
    238239}
    239240
    240 sub get_java_command {
    241     my $java = "java";
    242     if(defined $ENV{'GSDLHOME'}) { # should be, as this script would be launched from the cmd line
    243                                # after running setup.bat or from GLI which also runs setup.bat
    244     my $java_bin = &util::filename_cat($ENV{'GSDLHOME'},"packages","jre","bin");
    245     if(-d $java_bin) {
    246         $java = &util::filename_cat($java_bin,"java");
    247     }
    248     }
    249     return $java;
    250 }
    251 
    252241
    2532421; 
Note: See TracChangeset for help on using the changeset viewer.