So, the .jweb files are created in an editor by the
developer (me for example). Then, in e.g. Omegahat, the makefiles take
care of converting .jweb files to .java
files and from these compile the .class files.
The noweb tools are freely available from Norman Ramsey's Web pages. http://www.eecs.harvard.edu/~nr/noweb/
While we have used noweb for quite some time, it does have deficiencies. I am currently gradually developing a style and some tools which use XML for literate programming.
The messages from Antlr will be fixed when we finalize the language. At present, I don't think they should alarm us, but I welcome opinions.
$OMEGA_HOME/Config
I get an error about GNUmakefile.rules. What is this and how do
I fix it?
javac
compiler in Sun's JDK. This specifies a top-level directory
into which the packages' class files are written.
You can have this specified for each invocation of
javac
by editing the local.config file in the
$OMEGA_HOMEConfig/
directory and appending -d directory
to the value of JCFLAGS
For example,
JCFLAGS= -g -d /tmp/ClassFiles
An alternative is to use the -sourcepath
flag.
In spite of the ease with which this can be done, I think
it complicates matters. Firstly, one has to add this directory
to one's CLASSPATH environment variable.
Secondly, the dependencies in the compilation are more
complicated
and can be wrong. At best this means lengthier compilation times
when files are recompiled unnecessarily.
At worst, one can not recopmile class files when the source is
more recent and end up debugging for a long time.
The benefit of not having the class files show in listings of
source directories can be handled using correct filters built
into things like dired, completions in shell expansions, etc.
local.config,
provide a value for JAVAC
identifying the executable to use for a compiler.
For many of the compilers,
you will also need to specify where the core Java classes
can be found.
For example, to use Jikes along with the Kaffe classes, I use the settings
JAVAC=/usr/local/src/Jikes/jikes/src/jikes JAVA_CORE_CLASSES=/usr/local/share/kaffe/Klasses.jarWe also need a VM so as to build the grammar using the Antlr parser generator. So specify a value for the
JAVA variable.
Using the Jikes/Kaffe setup,
I get warnings about the .jar files not being
"valid zip file"s.
So, I simply unjar them and specify values in the local.config file for the different
places to find the class packages (i.e. remove the jar fule use.)
JAS=${OMEGA_HOME}/Jars
Repeat this for SWING, ANTLR
JHELP, JAS
Proceeding, I get several warnings about the paintBoder
method in the Swing JComponent class not overriding the
corresponding method in Component.
The Environment, Interfaces, Models and Numerics modules all build (with the same errors in Numerics).
As for running, of course one needs a JVM. Using JDK1.2, I get problems with the prompt - the second time it is evaluated it turns into the expression itself rather than the result of the expression. But basic expressions work.
x = 1 y = 3 x+y classLists().elementAt(0).size()
So far, we have only successfully used the Sun JDK. It would be good to hear from people who have used this or any other setup on Windows.
To compile Omegahat, you need to build the grammar, so you need a JVM.
s_object
and/or SEXP. How do I fix this?
getenv("SHOME")
or getenv("R_HOME") in the case of R.
% R
> getenv("R_HOME")
R_HOME
"/home/duncan/Projects/R/R"
So you can set R_HOME to this and restart the compilation.
setenv R_HOME /home/duncan/Projects/R/R
No package, class, or source file found named
To fix this, first make the target java and then JavaDocs. That is
make java JavaDocs
MyClass.methodand see what you get.
A common cause of this is not recompiling. Remove the .class file and recompile to ensure it is made.
A more subtle cause of this error arises when using noweb. Sometimes one forgets to reference the chunk defining the method(s) in the class definition. Check that there is a reference!
No class def errjava.lang.NoClassDefFoundError: Models/lib/Language/FormulaParsing (wrong name: org/omegahat/Models/lib/Language/FormulaParsing)
CLASSPATH variable contains an element
.
Basically, the internal Java class loader finds a reference
to the file, say,
Models/lib/Language/FormulaParsing.class
but this is actually the class
org.omegahat.Models.lib.Language.FormulaParsing.
and so there is a mismatch. This is the error message.
omegahat: -classpath: command not found
$OMEGA_HOME/Config
and issue the command
make runConfig
omegahat script
I get the message
Warning:: org.omegahat.Environment.Tools.ClassList.ClassList:: `/usr/jdk1.2/jre/classes' is neither a directory or an archiveclass java.io.File:
main()
Java method that arranges to read Omegahat scripts which
construct the prompt & input reader, the evaluator, etc.
Secondly, we build an entire list of all the class names
in the classpath elements. This requires reading numerous
directories and Jar files. You can simplify this by
running Omegahat within a directory that has few or
no sub-directories.
There is a mechanism to read serialized versions of the tables that are computed just a single time. These tables are not currently in the distribution.
options().remove("errorHandler")
can be invoked before the first error handler is
created. (I do this in the script
$HOME/.omegahatrc.)
Alternatively, if you want to clear the current error
handler, you must also
invoke the command
errorHandler(null)
output()
.
By default, this is an object of class
BasicTaskDisplay.
(Use the command output().getClass() to check this.)
This allows one to specify values for the number of initial and
end elements of the collection that are shown.
You can display the first k values
with a command
output().below(k)
This remains in effect until it is explicitly changed.
$HOME/.omgahatrc
You can also use this to set properties that you want to
override without changing the default properties file
OmegaOptions.
source("$HOME/.omegahatrc")
The answer to a different but related question is to consider using the FileLocator class. This allows one to register certain directories, jar files, etc. in which files can be located. The default initialization of the Omegahat environment adds
The best we can offer currently is to allow you to recompile a class before it is first loaded, but after the session has been started.
log, sin, etc?
Math.
For example,
Math.log(10)
Math.sin(Math.PI/2)
Rather than having to explicitly type the Math.
prefix, one can register this class as a source of "functions".
addFunctionTable(Math)
Then we invoke the calls above as
log(10)
sin(PI/2)
We can also register objects which provide non-static methods
with data potentially cached across calls.
See addFunctionTable()
No class def errjava.lang.NoClassDefFoundError: Test/org/omegahat/Environment/IO/PromptSource (wrong name: org/omegahat/Environment/IO/PromptSource) No class def errjava.lang.NoClassDefFoundError: ClassFiles/org/omegahat/Environment/IO/PromptSource (wrong name: org/omegahat/Environment/IO/PromptSource) No class def errjava.lang.NoClassDefFoundError: Test/org/omegahat/Environment/IO/PromptSource (wrong name: org/omegahat/Environment/IO/PromptSource)
/tmp/
in the classpath when the Omegahat classes are themselves
located in /tmp/Test/.
Thus when we are looking for the class PromptSource, we
find it first in the element /tmp/
as the file
/tmp/Test/org/omegahat/Environment/IO/PromptSource.class
and when we try to load it, we find that the class contained
in this file is not
tmp.Test.org.omegahat.Environment.IO.PromptSource
Hence the warning about the wrong name.
A general practice is to ensure that these directories containing classes do not contain other packages nested within them.
A simple way to install this is , to grab the code
from Kevin Hester's site and compile it and install
it in
(assuming your $OMEGA_HOME/libLD_LIBRARY_PATH variable includes this).
There are still "interesting" issues about threads, evaluation, etc.