The ScriptingEngine example (section 4.4) is not in the download bundle; it's intended as an analogy only and not as working code.
The PluginClassLoader.java file is found in the javageeks.com library.
The rest of the code is located here:
jar cvf com.javageeks.HelloWorld.jar HelloWorld.class
. Then, copy the .jar
file over to the Extensions directory (%JDKROOT%\jre\lib\ext
or
$JAVA_HOME/jre/lib/ext
), and try executing java HelloWorld
.
jar cvfm HelloDownload.jar manifest HelloDownload.class
.
Next, create another .jar file, Download.jar, by executing
jar cvf Download.jar Download.class version
. This means that HelloDownload.jar in
turn depends on (or will download) Download.jar. Copy Download.jar to the C:\
directory (or another directory, if you change the Class-Path
entry in the
manifest
file when creating the HelloDownload.jar
file), and run the
HelloDownload.jar
file: java -jar HelloDownload.jar
.
java -jar App.jar
and notice how the rest of the SwingSet classes get executed,
because the Extensions mechanism notes that App.jar in turn depends on "..\Ext\SwingSet.jar",
as specified in the Manifest file.