Deploying your Java Applets and Applications

 

 

 

Java Applets

The files needed on the web server include all Java class files that were generated from the Access or VB project, the HTML file, and the Diamond Edge Java classes which were installed (See below).

Java Applications

The files required on the client machine include the Java Runtime Environment (JRE) 1.1 or higher (Java 2 v1.2 recommended), the class files generated from the Access or VB project and the Diamond Edge Java classes which were installed (See below). In order to use swing, you will need most of the classes in the diamondedge.vb package and you will need the Java 2 JRE installed on the client.


Deploying Diamond Edge Java Classes

All or some of the Diamond Edge classes are necessary in order for your generated applets to function properly. All of the files in the diamondedge.vb, diamondedge.util and diamondedge.ado Java packages are royalty free to distribute with your application once you have purchased a license to VB Converter or Access Converter. The diamondedge.vb, diamondedge.util and diamondedge.ado packages are located in the jar file in the install directory: <installdir>\vbc.jar or <installdir>\ac.jar. In VB Converter, if you are using the AWT controls then the packages are in <installdir>\vbawt.zip file.

If you are using the Diamond Control Suite classes you will also need either <installdir>\dsuite_eval.jar or dsuite.jar which contain the classes in the diamondedge.swing package. This suite is also runtime royalty free to distribute with your Java application but requires a separate license to be purchased by each developer.

To get your application to be loaded from a different machine from the one it was developed on, you must copy the project html file and all of the compiled Java files that have a .class extension to the destination directory. You must also copy library file containing the Diamond Edge Java classes from the installation directory into the same directory as the html file.

If you were deploying the sample on a UNIX web server, you should have the following files in your directory:

Project1.html
Project1.class
frmTest.class
modTest.class
clsTest.class
vbc.jar

If you are not referencing the jar or zip file from your .html class then you will need to extract (unzip) all of the files and directories in the vbc.jar, ac.jar, or vbawt.zip file into the same directory as the .html file IMPORTANT: Copy the diamondedge directory and all sub-directories into the same directory as your HTML file. The diamondedge directory itself must exist not just the class files since Java uses the directory structure as a naming convention. For example, the file name for the class diamondedge.vb.Application is diamondedge\vb\Application.class. If you were deploying the sample on a UNIX web server, you should have the following files in your directory:

Project1.html
Project1.class
frmTest.class
modTest.class
clsTest.class
diamondedge/vb/Application.class
diamondedge/vb/AwtForm.class
... (i.e. diamondedge/vb/*.class)
diamondedge/ado/AdoConst.class
diamondedge/ado/AdoCursor.class
... (i.e. diamondedge/ado/*.class)


File IO

If you are deploying your applet on a webserver, Java does not allow you to write to the file system, so all file input and output will result in Java security violations. You should consider running your application as a stand-alone application or change it to use a database instead of files.


Debugging in a Java IDE

If you want to load the code in a Java IDE such as Visual Cafe, JBuilder, VisualAge, or JDeveloper you will need to setup the projects properly for the environment to be able to access the Diamond Edge Java library.

  1. Make sure you have selected the right IDE in the Options dialog. This can also be changed in the VBConverter.ini or AccessConverter.ini file.
  2. After creating a project you will need to add one of the following jar files to the classpath:
    • VB Converter requires: vbc.jar
    • Access Converter requires: ac.jar
    If you are using the Diamond Control Suite classes you will also need either dsuite_eval.jar or dsuite.jar added to the classpath.

    Consult the manual for your IDE on how to add third party libraries to a project classpath. Be sure to put in the full path to the jar file such as "c:\Program Files\VB Converter\vbc.jar".