Britannica no Linux?

2

Você conseguiu executar a Britannica no Linux? Existe uma página sobre isso - mas não consigo fazer funcionar. Nem funciona através do vinho.

Editar 2 :

Meu DVD da Britannica é um de 2011. Na página acima, há um script em perl para a versão de 2004 da Britannica.

Estou no Kubuntu 11.04

 java -version 

dá:

java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode) 

Eu também tentei seguir essa página sem sorte. E também comentou o cheque da versão britannica. O script original me deu erros na linha 102. Então eu adicionei estas linhas

print "product_id is ", $product_id, "\n";
print "BCDDIR is ", $BCDDIR, "\n";
print "product_jar is ", $product_jar, "\n";

para fins de depuração. Agora o script é:

#!/usr/bin/perl -X
#
# Copyright (C) 2004 Encyclopaedia Britannica, Inc.
#
# Perl script to install and run any single disc,
# 2004 Encyclopaedia Britannica product on a modern
# Linux installation. 
#
# This Perl script, including the source code, documentation
# and related data, is placed into the public domain.
#
# The original author is Benjamin Gimpert.
# Modifications by Brian Schultz and Kevin Boers.
#
# THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY
# OF ANY KIND, NOT EVEN THE IMPLIED WARRANTY OF
# MERCHANTABILITY. THE AUTHOR OF THIS SOFTWARE,
# ASSUMES _NO_ RESPONSIBILITY FOR ANY CONSEQUENCE
# RESULTING FROM THE USE, MODIFICATION, OR
# REDISTRIBUTION OF THIS SOFTWARE.
#
# For more information, contact:
#
#     Encyclopaedia Britannica, Inc.
#     Attn: Software Development
#     310 South Michigan Ave
#     Chicago, IL 60604, U.S.A.
#     http://support.britannica.com/
#

#
# KNOWN BUGS
# - many Java VM messages of the form "Font specified in font.properties not
#   found", fixed by replacing your .../jdk/jre/lib/font.properties with:
#       http://java.sun.com/j2se/1.3/font.properties
# - preferences must be edited manually under:
#       ~/britannica/[product]/conf/[user].[product].preferences.properties
# - on the first .show(), marketing dialogs are too small
#

$ENV{JAVA_HOME} = "/usr";

print "Enter location of the Britannica Software:";
my $input = <STDIN>;
chomp ($input);
if ($input)
        {
        $BCDDIR = $input;
        }
else 
        {
        $BCDDIR = ("/home/boris/virtual-drives/1");
        }

my %PRODUCTS = (
    'Children\'s Edition CD', 'BcdChildApp.jar',
    'Concise CD', 'BcdConciseApp.jar',
    'Britannica Deluxe Edition 2004', 'BcdDeluxe.jar',
    'Homework Essential', 'BcdKids.jar',
    'Ready Reference CD', 'BcdReadyRefApp.jar',
    'Britannica Standard Edition 2004', 'BcdStandard.jar',
    'Homework Essential Plus', 'BcdStudent.jar',
    'Ultimate Reference Suite', 'URSApp.jar',
    'Ultimate Reference Suite CD-ROM', 'URSCDApp.jar',
);

my $start_dir = 'pwd';
chomp($start_dir);
#eval <<'EOF_CHDIR_EVAL';
print "Changing to home directory...";
chdir or die "\n  failed";
print " done\n";
if (! (-e 'britannica')) {
    print "Making work directory ~/britannica/...";
    mkdir('britannica') or die "\n  failed";
    print " done\n";
}
print "Changing to work directory...";
chdir('britannica') or die "\n  failed";
print " done\n";

print "Searching for product JAR...";
my $product = '';
open (AUTORUN_INF, "< $BCDDIR/autorun.inf") or die "\n  failed";
while (<AUTORUN_INF>) {
    chomp;
    $product = $1 if (/^value=([^\n\r]*)/);
}
close (AUTORUN_INF) or die "\n  failed";
my $product_jar = $PRODUCTS{$product};
# die "\n  failed" if ($product_jar eq '');
print " found \"$product_jar\"\n";

print "Searching for default preferences file name in product JAR...";
'$ENV{JAVA_HOME}/bin/jar tf $BCDDIR/jars/$product_jar' =~ /^(\w+)\.preferences\.properties\.default/m;
my $product_id = $1;
my $default_preferences_file = $product_id . '.preferences.properties.default';
print " found \"$default_preferences_file\"\n";

print "product_id is ", $product_id, "\n";
print "BCDDIR is ", $BCDDIR, "\n";
print "product_jar is ", $product_jar, "\n";

if (! (-e $product_id)) {
    print "Making a work directory for this product...";
    mkdir($product_id) or die "\n  failed";
    print " done\n";
}
print "Changing to work directory for this product...";
chdir($product_id) or die "\n failed";
print " done\n";

print "Checking for version 1.3 of the Java VM...";
die "\n  failed" if (! (-e $ENV{JAVA_HOME}));
my $java_version_string = '$ENV{JAVA_HOME}/bin/java -version 2>&1';
$java_version_string =~ /java version \"([0-9\._]+)\"/;
my $java_version = $1;
# die "\n  failed, found \"$java_version\"" if (! ($java_version =~ /^1\.3/));
print " found \"$java_version\"\n";

print "Constructing launch CLASSPATH...";
my $classpath = '';
my @jars = <$BCDDIR/jars/*.jar>;
if (scalar(@jars) > 0) {
    $classpath = ".";
    foreach $jar (@jars) {
      $classpath .= ":$jar";
    }
}
$classpath .= ":$BCDDIR/imagefiles/";
print " done\n";

print "Constructing system properties for the Java VM command line...";
my $options = '';
$options .= '-Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser';
$options .= ' -Djava.protocol.handler.pkgs=com.britannica.net\|org.apache.naming.resources';
$options .= ' -Dcom.britannica.configurator.configuratorPropFile=britannica.ini';
$options .= ' -Dcom.britannica.lucene.search.searchPropFile=britannica.ini';
$options .= ' -Djdbc.drivers=com.britannica.cd.db.AxionCDConnectionDriver:oracle.jdbc.driver.OracleDriver:org.apache.commons.dbcp.PoolingDriver:com.britannica.db.proxy.ConnectionProxyDriver:org.axiondb.jdbc.AxionDriver';
$options .= ' -Dorg.axiondb.engine.TransactionManagerImpl.NEVER_APPLY=true';
$options .= ' -Djava.class.path=' . $classpath;
print " done\n";

if (! (-e 'britannica.ini')) {
    print "Extracting the application configuration file from product JAR...";
    '$ENV{JAVA_HOME}/bin/jar xf $BCDDIR/jars/$product_jar britannica.ini'; die "\n  failed: $!" if $?;
    print " done\n";

    print "Altering the application configuration file with local settings...";
    my $britannica_ini = '';
    open (BRITANNICA_INI_FILE, "< britannica.ini") or die "\n  failed";
    while (<BRITANNICA_INI_FILE>) {
      $britannica_ini .= $_;
    }
    close (BRITANNICA_INI_FILE) or die "\n  failed";

    # regexp's to modify britannica.ini here:
    $britannica_ini =~ s/^LOCAL=.*/LOCAL=\./m;
    $britannica_ini =~ s/^BCDDEV=.*/BCDDEV=$BCDDIR/m;

    open (BRITANNICA_INI_FILE, "> britannica.ini") or die "\n  failed";
    print BRITANNICA_INI_FILE $britannica_ini;
    close (BRITANNICA_INI_FILE) or die "\n  failed";
    print " done\n";
}

if (! (-e 'index/')) {
    print "Unzipping index archive in the local filesystem...";
    'unzip $BCDDIR/index.zip'; die "\n  failed: $!" if $?;
    print " done\n";
}

if (! (-e 'data/')) {
    print "Making data directory in the local filesystem...";
    mkdir('data') or die "\n  failed";
    print " done\nUnzipping autocomplete archive in the data directory...";
    'unzip $BCDDIR/autocomplete.zip -d data'; die "\n  failed: $!" if $?;
    print " done\nCopying local databases to the data directory (slow!)...";
    'cp -R $BCDDIR/data/* data'; die "\n failed: $!" if $?;
    print " done\n";
}

if (! (-e 'conf/')) {
    print "Making preferences directory in the local filesystem...";
    mkdir('conf') or die "\n  failed";
    print " done\n";
}

if (! (-e 'conf/' . $default_preferences_file)) {
    print "Extracting the default preferences file from product JAR...";
    '$ENV{JAVA_HOME}/bin/jar xf $BCDDIR/jars/$product_jar $default_preferences_file'; die "\n  failed: $!" if $?;
    print " done\nMoving default preferences file to the preferences directory...";
    'mv $default_preferences_file conf/'; die "\n  failed: $!" if $?;
    print " done\n";
}

my $command = "java $options com.britannica.cd.AppMain";
print "Launching the Java VM...\n";
system($command);
#EOF_CHDIR_EVAL
print "Changing back to startup directory...";
chdir($start_dir) or die "\n  failed";
print " done\n";

e dá:

Enter location of the Britannica Software:
Changing to home directory... done
Changing to work directory... done
Searching for product JAR... found ""
Searching for default preferences file name in product JAR...java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:131)
        at java.util.zip.ZipFile.<init>(ZipFile.java:92)
        at sun.tools.jar.Main.list(Main.java:997)
        at sun.tools.jar.Main.run(Main.java:242)
        at sun.tools.jar.Main.main(Main.java:1167)
 found ".preferences.properties.default"
product_id is
BCDDIR is /home/boris/virtual-drives/1
product_jar is

  failed at ./linux-launch2.0.pl line 106.
Making a work directory for this product...

Como você pode ver - as variáveis product_id e product_jar não são nada - o que acho que causa o problema.

A linha 106 é:

mkdir($product_id) or die "\n  failed";

$ product_id é (linha 96)

$product_id = $1

$ 1 é a primeira captura na linha 95, aqui está a linha:

'$ENV{JAVA_HOME}/bin/jar tf $BCDDIR/jars/$product_jar' =~ /^(\w+)\.preferences\.properties\.default/m;

Será muito legal se conseguirmos rodar a Britannica no Linux!

    
por Adobe 20.09.2011 / 18:28

1 resposta

1

Você não seguiu corretamente as instruções de Silas Brown e perdeu o ponto-e-vírgula no final da declaração, que é mostrado nessas instruções. É claro, você só precisa daquela parte das instruções de M. Brown se não seguiu corretamente as instruções da original Britannica - sobre a configuração da variável de ambiente JAVA_HOME em ~/.profile , ~/.bashrc ou algum lugar semelhante - em primeiro lugar.

    
por 20.09.2011 / 23:20

Tags