2

Вам удалось запустить Britannica в Linux? Есть страница об этом - но я не могу заставить ее работать. И это не работает через вино.

Изменить 2:

Мой DVD Британника 2011 года. На странице, указанной выше, есть сценарий Perl для версии Britannica 2004 года.

Я на Kubuntu 11.04

 java -version 

дает:

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) 

Я также попытался следовать этой странице без удачи. А также прокомментировал проверку британской версии. Оригинальный скрипт дал мне ошибки в строке 102. Поэтому я добавил эти строки

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

в целях отладки. Теперь скрипт выглядит так:

#!/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";

и это дает:

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...

Как видите, переменные product_id и product_jar - это ничто, что, я думаю, вызывает проблему.

Строка 106 это:

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

$ product_id is (строка 96)

$product_id = $1

$ 1 - первый захват в строке 95, вот строка:

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

Будет очень здорово, если нам удастся запустить Britannica в Linux!

1 ответ1

1

Вы не правильно следовали инструкциям Сайласа Брауна и пропустили точку с запятой в конце утверждения, которое показано в этих инструкциях. Конечно, эта часть инструкций М. Брауна нужна вам только в том случае, если вы не правильно выполнили первоначальные инструкции Britannica - об установке переменной окружения JAVA_HOME в ~/.profile , ~/.bashrc или где-то подобном - в первую очередь. ,

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .