您是否已成功在 Linux 上运行 Britannica?页关于这一点 - 但我无法让它工作。它也无法通过 wine 工作。
编辑2:
我的大英百科全书 DVD 是 2011 年版的。在上面链接的页面中,有一个适用于 2004 年版大英百科全书的 perl 脚本。
我在 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 是(第 96 行)
$product_id = $1
$1 是第 95 行的第一个捕获,如下行:
`$ENV{JAVA_HOME}/bin/jar tf $BCDDIR/jars/$product_jar` =~ /^(\w+)\.preferences\.properties\.default/m;
如果我们能够在 Linux 上运行大英百科全书,那将非常酷!
答案1
您没有正确遵循 Silas Brown 的说明,并且遗漏了语句末尾的分号,这些说明中显示了这一点。当然,如果您没有正确遵循 M. Brown 的说明,那么您只需要这部分原来的 大英百科全书首先,关于JAVA_HOME
在~/.profile
、或类似位置设置环境变量的说明。~/.bashrc