next up previous
Next: Compiling JavaBayes Up: JavaBayes Version 0.346 Bayesian Previous: Downloading JavaBayes


Running JavaBayes

You can run JavaBayes in two different ways.

First, you can run it as an applet, inside a world-wide-web document using the APPLET tag in HTML. Note that in this mode, you are restricted by the Java sandbox model, so you cannot perform a number of operations. For example, you cannot load/save files from the local file system. Suppose you install the JavaBayes class files in the directory Classes; you would use the following piece of code in your HTML page to call JavaBayes:

<APPLET
CODEBASE="Classes/"
CODE="JavaBayes.class">
</APPLET>

Second, you can run JavaBayes as an application. After you download JavaBayes, the easiest thing is to go to the Classes directory and type

java JavaBayes
This should invoke the java runtime interpreter and tell it to load the class JavaBayes. You should see the JavaBayes windows pop out in a moment. If you have problems at this point, try checking your Java virtual machine and your classpath.

If you have your CLASSPATH variable set properly, you should be able to run JavaBayes anywhere just typing

java JavaBayes

Basically, the CLASSPATH tells the interpreter where to look for classes, and you can set it either as a system variable or as a parameter to the java interpreter. Usually the Java compiler will have a system classpath, and the compiler appends the contents of an environment variable CLASSPATH to the system classpath. You have to set up CLASSPATH so that the compiler can read files in the local directory and in the directory that contains the JavaBayes classes. Here is an example for the variable CLASSPATH:

CLASSPATH=.:/usr/users/your-name-here/Java/JavaBayes/Classes/


next up previous
Next: Compiling JavaBayes Up: JavaBayes Version 0.346 Bayesian Previous: Downloading JavaBayes
Fabio Gagliardi Cozman
2001-1-31