Classpath is a bummer.
The classpath is where java looks for all the files it needs to run your application. The files it needs are 1)your code, 2)the vbp.jar, 3)QTJava.zip and of course 4) java's rt.jar. It need these files for both compiling and for running the java. Here are the error messages you will get when these files are not in the right place and a way to tell java where to look for them in the command line. I will then show you how to get around those errors in a more civilized enviroments like Textpad and Codewarrior.
Command Line:
If you get an error like:
C:\testvbn\PickNTrack.java:22: cannot resolve symbol symbol : class PixelSource location: class PickNTrack static PixelSource ps;
It means that the compiler can't find your vbp.jar file. Usually if it is in the same directory that is enough but sometimes not. The following would force the compiler to look in the current directory (.) and for the file "vbp.jar" These two things are separated by a semicolon.
C:\yourfolder>javac -classpath .;vbp.jar PickNTrack.java
If you get an error like:
Exception in thread "main" java.lang.NoClassDefFoundError: PixelSource at PickNTrack.main(PickNTrack.java:44)
It means that your java runtime cannot find the vbp.jar file. The following will force java to look in the current directory (.) and for the file "vpb.jar". These two things are separated by a semicolon.
C:\yourfolder>java -classpath .;vbp.jar PickNTrack
If you get an error like:
C:\testvbn>java -classpath .;vbp.jar PickNTrack Exception in thread "main" java.lang.NoClassDefFoundError: quicktime/std/StdQTConstants
It means that your java runtime cannot find the QTJava.zip file. Theoretically the Quicktime installer put it in ...yourJRE\lib\ext but maybe you several jre's installed on your machine or maybe you did not have any when Quicktime was installed.
You can find out which jre you are using with this command:
java -version
Sometimes quicktime sets the classpath when it installs and you can look there to see where it put the QTJava.zip file. Use this command.
set classpath
Your can remedy the stituation by copying the QTJava.zip file in to every ...jre/lib/ext folder on your machine (there may be more than you think). Otherwise you can add the QTJava.zip file to the classpath like you have been doing but this time add QTJava.zip separated by a semicolon to the list of places in the classpath..
java -classpath .;vbp.jar;QTJava.zip PickNTrack
TextPad
Of course developing java on the command line is a little barbaric. My favorite tool for beginners is textpad which can be downloaded for free from textpad.com. It has a pulldown menu for compiling and another one for running your java. Here are some screen shots for how to set the preferences to get around the above errors in textpad.
This accomplishes
the same thing as entering on the command line:C:\yourfolder>javac -classpath
.;vbp.jar PickNTrack.java
This accomplishes the
same thing as entering on the command line:C:\yourfolder>java -classpath
.;vbp.jar PickNTrack
By the way In textpad I often get this error when trying to run an application. you have to make sure to highlight the name of the .java file that I want to run in the window on the left.
Usage: java [-options] class [args...]
(to execute a class)
or java -jar [-options] jarfile [args...]
(to execute a jar file)
Codewarrior
Using an IDE (Integrated Development Environment) can make programming in lower level languages like Java feel more like using higher level languages like Lingo. They allow you to marshall all the files needed for the project, color code the text and sometimes suggest code and provide documentation about the code, even allow you to create interfaces by dragging and dropping while the IDE automatically writes the code. After writting your program the IDE can compile code, ftp files after you compile it, run the code all with one keystroke. They also give you much better debugging tools for stepping through code as it is running.. You could look at Director as being the IDE for lingo. Unlike lingo which has only one possible environment (Director) there are many different brands of IDE's for Java. We will be using Codewarrior but Micorsoft's Visual Studio is also popular (if only on the PC). Along with all the added features come a rather complicated interface which will send many of you running back to the simplicity of good old shareware TextPad (not a bad choice). If you plan to program a lot, it is worth mastering an IDE and here as some key elements of the interface of codewarrior to master.
1) The first thing you should do is create a project. You will see that there are several wizards to walk you through this process.
2) You have to add the files that you expect to use. Normally Java looks for the machine's classpath to find files (which is sometimes a pain) but codewarrior allows you to explicitly point to the files that you want to use. You would of course add the .java files for the classes that you are writting (eg VideoByPixelPickNTrack.java) but also the supporting classes that you are using. You should add "rt.jar" which is contains the mother load of all the normal java classes and is installed whenever you install Java, and in this example you would add the QTJava.zip which is usually installed with Quicktime and translates from Quicktime to Java. Finally in this example you would also add a file called VideoByThePixel.zip which contains classes written by me which make it easier to acces the pixels within the video. You might do a search on your machine for these file so you know where they are before you add them.

3) Next you should adjust the setting for your project. You can have one set of preferences for the whole program and then another set of preferences (settings) for each project (actually two one for debug and one for release but don't worry about that for now). You might browse throught the settings but two items might need your attention, "Target" and "OutPut."