Once you have things set up correctly, the system is relatively easy to use. However, there are certain things that, if not properly set up, can mess things up. The main way to keep things simple is to not use any of the VisualCafe-specific java code, virtual machines, and so on, but rather to stick with the standard Java jdk 1.3. I show you how to do this below.
There are two places where we have to worry about making sure things are set up correctly. One is a global setting, that applies every time you use the system, independly of what project you are working on. This should already be set up properly for you, but you should double-check that it is correct, using the instructions below, and be careful to not change the settings for this. The other is specific to each VisualCafe Project you set up.
When you create a project, VisualCafe makes a set of special files that it associates with the project, that aren't a standard part of java. These have to be stored somewhere. Your java source files and class files also have to be stored somewhere. This is the second thing I tell you how to set below.
There is a java package standard developing in which you make the directory structure look like internet DNS names. (I'm using Unix-style pathnames here; the equivalent in windows machines converts the / to \ and converts "/home" to H:, also known as \\herald\homes .) For example, java code for ecommerce written by sun might be stored in a directory called
com/sun/ecommerce
and software written by the LINDI project within my research group (which is called BAILANDO) might be stored under
edu/berkeley/bailando/lindi/
You need a top-level root directory above all this as well. I suggest you make directories something like this in your home directory:
/home/yourlogin/is255/projects
/home/yourlogin/is255/src
The idea is for you to put your java and your class files in the src directory, and put the special project files that VisualCafe makes in the projects directory. If you end up using some code from elsewhere, you can put it under the src directory too. So to do an assignment that uses code that you copied over from my research group you might create these directories and files:
/home/yourlogin/is255/src/assignment1/coolcode.java
/home/yourlogin/is255/src/assignment1/coolcode.class
/home/yourlogin/is255/src/edu/berkeley/bailando/lindi/helpfulcode.java
/home/yourlogin/is255/src/edu/berkeley/bailando/lindi/helpfulcode.class
You can create a project called Assignment1 in VisualCafe that uses these two java files. It would be stored in
/home/yourlogin/is255/projects/Assignment1.vep
Hopefully, after you use this the first time you won't need to do it again.
Now check to be sure you have the right virtual machine. The next two images show how to see the VM: go to Tools > Environment Options and select the Virtual Machines tab. It should be set to java1.3.0b as shown. Note that if you set things up this way you don't need to specify a classpath in your overall Windows environment.
If you have the correct VM, then skip the steps between the horizontal lines below.
If you have the correct VM, then skip the steps between these horizontal lines.
Otherwise, if you don't have the right VM, do the following, as shown. Click on the New button. You'll get a dialog box asking for Name and Executable. Give it the name java1.3.0b (or really, whatever you want) and select as the executable C:/Program Files/jdk/java.exe
Now you should be set with the right VM and the right path and classpath for the java VM
and the java libraries, and shouldn't need to change this again.
Note: If you have to take this step, make certain that neither of
the two classpaths in this dialog box have any VisualCafe paths in
them. If they do, you must edit out the VisualCafe paths.
Next we need to look at what happens when you create a new Project.
Go to File > New Project and select Empty Project, as shown in the next three images.
Once you have a new active (although untitled) project, you should be able to access the Project menu. You'll spend a lot of time in this menu -- it is used for compiling, debugging, and running your java programs. For some reason, they've made the Options tab hard to get too, even though it is rather important. It's at the bottom of the menu, as shown.
When you first create a new project, it is very important that you set one set of things thing up correctly. These are found under the Directories tab, as shown.
First, select Input Class Files. This takes care of setting up the classpath for you (and this is why it is convenient to have all your source files in one main directory -- you just set one top-level directory here, and things should just work). Set this to be the top of your source directory. From the discussion of directories above, you would set this to:
/home/yourlogin/is255/src/
Keep the two checkboxes set, as they are be default.
Next, select Output Files. Set this to also be the top of your source directory, since we'll be storing class files in the same directories as their corresponding source files.
Notice that VisualCafe tries to put them in a local directory on the C drive. We don't want this! If you don't set this to point somewhere in your home directory, the next time you start VisualCafe on another machine, you won't be able to find your class files! And other people will be able to see yours.
Your actual directories will be different than the samples shown in the screenshots; see Setting Up Your Directories above.
The last thing we have to do is tell VC where to put the project files. You have to do
this in a different menu. To do this, go to
File > Save All
This saves the project and any files you might have made. Give the project a name and save it in the projects directory discussed in Setting Up Your Directories above.
This is all you need to worry about for setting things up. Once you have a project set up, you shouldn't need to change any of these settings again. However, whenever you define a new project, you have to change the directory settings.
MAH -- last modified 9/3/01