Getting Started – Building Applications for JANOS in Netbeans

We use NetBeans but any Java IDE will work!

The Required Java Platform

Applications that will run on the JNIOR Model 410 must be built against JDK 1.6. Actually JDK 1.4 and later will work. JANOS has not yet been verified against versions of Java after 1.6. You will need to install the 1.6 JDK on your machine. If you are unable to find the installation package contact INTEG and we can provide it to you. In Netbeans go to Tools|Java Platforms and use Add Platform… to add the 1.6 JDK if it is not already present. If you are going to do a lot of application programming for JNIOR you might specify this platform as the “default”.

JANOS Class Library

Applications targeted to run under JANOS must be built against the JANOS Class Library. This library can be found in the etc/ folder on your JNIOR Model 410. This file is OS version dependent although it is likely not to change dramatically from release to release. You might note the date and before you update or finish an application for your JNIOR make sure that you are using the latest version that you have available. INTEG can also send you a copy of JanosClasses.jar on request.

Creating a Java Application

  1. Create your new application in Netbeans. Select File|New Project and insure that “java” and “Java Application” are selected. Click Next. Assign your project a name and click Finish.
  2. Right-click on the project in the Projects Navigation tree and go to Properties.
  3. Select Libraries and click Add JAR/Folder. Navigate to the copy of the JanosClasses.jar file and click Open to add it to the projects libraries.
  4. Make sure that the Java Platform is JDK 1.6. You may need to install that version of JDK as noted above.
  5. Select @Sources” and make sure that the “Source/Binary Format” near the bottom of that dialog specifies JDK 1.4. Again JANOS may operate with other source levels however it has only been verified at that level.

Getting the IDE to recognize the JANOS Class Library sources.

You will need to adjust the JDK 1.6 platform to allow the IDE to reference the JANOS Class Library sources in working with your code.

  1. Go to Tools/Java Platforms and select the 1.6 JDK.
  2. Select the Sources tab and use @Add JAR/Folder…” to navigate to and open the JanosClasses.jar file.
  3. Once added select the JanosClasses entry in the list and click Move Up. If you are developing solely for JANOS you can safely use remove to remove the reference to the JDK sources. This will greatly reduce any confusion that might occur with pop-up tips and intellisense information.

Giving Precedence to JanosClasses.jar

In order to insure that the classes stored in the JANOS Class Library take precedence over any that might be also present in the JDK you can modify the project properties.

  1. Open the ../nbproject/project.properites file.
  2. Locate the endorsed.classpath property and set it equal to ${file.reference.JanosClasses.jar} which should be the same as the javac.classpath property setting if you had properly added JanaosClasses.jar above.

This will insure that the JanosClass.jar file is searched before any other library. As of the time of this writing we do not know of a way to prevent the Java Compiler from referencing the installed platform libraries.

Specifying the Main Class

JANOS uses the manifest file in the JAR to locate the main class for starting up an application. Go to @Project Properties|Run” and make sure that your main class is listed.

Debug

The program JAR may be built with debugging information but since JANOS does not utilize this information there is no need. Uncheck the ‘Generate Debugging Info’ checkbox in Project Properties|Build|Compiling dialog_. This saves a considerable amount of space. When checked this option includes the source file name, includes cross references from JVM program counter to source file line numbers, and includes names and descriptors for all local variables. During debugging this would allow detailing information to be displayed by a debugger however JANOS does not (currently) have this capability.

Compression

A compressed JAR file can save space (and download time). JANOS can utilized both compressed and uncompressed JAR files. It is recommended that you check the ‘Compress JAR File’ checkbox in Project Properties|Build|Packaging. While decompressing a class file adds a small amount of time to program execution, saving the file space may be important. Compression is optional.