Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Alice 2.0 and Java 5.0
Old
hgs
Guest
 
Status:
Posts: n/a
Default Alice 2.0 and Java 5.0 - 08-07-2006, 10:56 AM

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.
   
Reply With Quote
Old
lanceA
Guest
 
Status:
Posts: n/a
Default 08-07-2006, 11: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.
   
Reply With Quote
Alice under Java 5
Old
hgs
Guest
 
Status:
Posts: n/a
Default Alice under Java 5 - 08-08-2006, 05:21 AM

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.)
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.