I don't know. Maybe I should have taken a course on Java.
I don't understand how to create a library... AT ALL. I'm reading the instructions four or five times now and there's no clear way to do it.
From the howto.txt:
A very basic library example:
Code:
package libraryexample;
public class BoringLibrary {
PApplet parent;
public BoringLibrary(PApplet parent) {
this.parent = parent;
parent.registerDispose(this);
}
public void dispose() {
// anything in here will be called automatically when
// the parent applet shuts down. for instance, this might
// shut down a thread used by this library.
}
}
What is all this? The line "package libraryexample;" immediately gives me an error during compile...
When I'm writing a library, do I actually enclose all of my functions and classes within "public class className"?
And after I fit my code into this standard, what do I do? Do I hit play, and take the .jar out? This doesn't seem to work (compile error: java.lang.InstantiationException: BoringLibrary)
The howto.txt says:
Quote:Creating .jar Files For Your Library
Since your code is inside a package, you need to make sure that its
inside subfolders in the .jar file. It should be noted that jar files
are simply .zip files (they can be opened with WinZip or Stuffit) with
a "manifest" file.
In the past, you may have used:
javac *.java
to compile your files. Once they're inside a packages, you must use:
javac -d . *.java
which will create folders and subfolders for the packages. For
instance, for all the stuff in processing.core.* it would create:
processing/ ->
core/ ->
PApplet.class
PGraphics.class
..etc
then you can jar that stuff up using:
jar -cf core.jar processing
or with the command line info-zip utility:
zip -r core.jar processing
Typing javac in console gives me a:
"'javac' is not recognized as an internal or external command, operable program or batch file."
Eh. Totally confused here. Anyone have a step-by-step way to do it? It can't be this hard...