View Full Version : Alice 2.0 and Java 5.0
Trying to build Alice 2.0 on a sun sparc solaris9 system, I get a large number of compilation errors. These are mostly about missing packages. If I recall correctly Alice was developed with Java 1.3. Should I be able to build it with 5.0 (which is 1.5 really, I think), or will I need to heavily modify it to do this?
Thank you.
lanceA
08-07-2006, 10:32 AM
Java 5 (Tiger),also known as 1.5, includes major updates from 1.3. I can't even compile code written for 1.4.2 using 1.5 without getting numerous errors/warnings. However the packages you speak of could also relate to the Java 3D libraries.
I think it is due to the Alice libraries themselves:
neelix hgs 13 %> gmake
javac alice/authoringtool/dialog/AliceAlertContentPane.java
alice/authoringtool/dialog/AliceAlertContentPane.java:38: package edu.cmu.cs.stage3.swing does not exist
public abstract class AliceAlertContentPane extends edu.cmu.cs.stage3.swing.ContentPane {
^
alice/authoringtool/dialog/AliceAlertContentPane.java:47: package edu.cmu.cs.stage3.alice.authoringtool.util does not exist
protected edu.cmu.cs.stage3.alice.authoringtool.util.ImagePa nel errorIconPanel = new edu.cmu.cs.stage3.alice.authoringtool.util.ImagePa nel();
^
alice/authoringtool/dialog/AliceAlertContentPane.java:48: package edu.cmu.cs.stage3.alice.authoringtool.util does not exist
protected
[truncated due to char count limit]
neelix hgs 14 %>
(This is from a Makefile I generated with the following Ruby script:
<pre>
neelix hgs 23 %> cat dependencies.rb
#!/usr/local/bin/ruby -w
require 'find'
class MakefileBuilder
def initialize()
@dependencies = Hash.new { [] }
end
def process(adir, path)
newpath = path.gsub(/^#{adir}\//, '')
if File.basename(path) =~ /\.java$/
classfile = newpath.gsub(/\.java$/, ".class")
unless @dependencies.has_key?(classfile)
@dependencies[classfile] = [newpath]
end
open(path, "r") do |fp|
while line = fp.gets()
if line =~ /^\s*import\s+edu\.cmu.cs.stage3.(\S*?);/
name = $1
if name !~ /\.java$/
name.gsub!(/\./, '/')
# name += ".java"
name += ".class"
else
if name =~ /\.\*$/
puts "import name #{name} ends in .*"
next
end
name.gsub!(/\.java$/, '')
name.gsub!(/\./, '/')
# name += ".java"
name += ".class"
end
@dependencies[classfile] << name if File.exist?(name)
end
end
end
end
end
def find(adirectory)
Find.find(adirectory) do |path|
# puts "#{path}, #{path.class}"
if FileTest.directory?(path)
if File.basename(path) =~ /^(\.\.?)/
puts "pruning #{path} as it matches #{$1}"
Find.prune # Don't look any further into this directory.
else
next
end
else
# total_size += FileTest.size(path)
process(adirectory, path)
end
end
return self
end
def writefile
open("Makefile", "w") do |mf|
mf.puts "all: #{@dependencies.keys.join(%q< >)}"
mf.puts
@dependencies.each_pair do |k,v|
puts "#{k}: #{v.inspect}"
mf.puts "#{k}: #{v.join(%q< >)}"
mf.puts "\tjavac $<"
mf.puts
end
end
end
end
MakefileBuilder.new().find(Dir.pwd).writefile
neelix hgs 24 %>
</pre> (Good job it isn't Python: this loses indents)
because the Alice Zip file has no makefile, ant file or build scripts. it may
be that I've missed something in constructing this.)