diff options
-rw-r--r-- | Readme.html | 78 | ||||
-rw-r--r-- | build.xml | 18 | ||||
-rw-r--r-- | src/main/javassist/rmi/package.html | 2 | ||||
-rw-r--r-- | src/main/javassist/web/package.html | 2 | ||||
-rw-r--r-- | tutorial/tutorial2.html | 10 |
5 files changed, 76 insertions, 34 deletions
diff --git a/Readme.html b/Readme.html index 77b69712..672da1c9 100644 --- a/Readme.html +++ b/Readme.html @@ -72,31 +72,42 @@ other editors. <h3>1. Move to the directory where this Readme.html file is located.</h3> -<p>In the description below, we assume that the platform is JDK 1.2 -(or later) for Solaris. If the platform is JDK 1.2 (or later) for -Windows, the class-path option is: +<p>In the following instructions, we assume that the javassist.jar +file is included in the class path. +For example, the javac and java commands must receive +the following <code>classpath</code> option: <ul><pre> --classpath ".;javassist.jar" +-classpath ".:javassist.jar" </pre></ul> -<p>If you don't want to put the class-path option, copy -<tt>./javassist.jar</tt> to +<p>If the operating system is Windows, the path +separator must be not <code>:</code> (colon) but +<code>;</code> (semicolon). The java command can receive +the <code>-cp</code> option +as well as <code>-classpath</code>. -<ul><<i>java-home</i>><tt>/jre/lib/ext/</tt>.</ul> +<p>If you don't want to use the class-path option, you can make +<code>javassist.jar</code> included in the <code>CLASSPATH</code> +environment: -<p><<i>java-home</i>> depends on the system. It is usually -<tt>/usr/local/java</tt>, <tt>c:\jdk1.2\</tt>, etc. +<ul><pre> +export CLASSPATH=.:javassist.jar +</pre></ul> + +<p>or if the operating system is Windows: -<p>If you don't use javassist.jar, first compile Javassist: <ul><pre> -% cd src -% javac -d .. javassist/*.java javassist/*/*.java -% cd .. +set CLASSPATH=.;javassist.jar </pre></ul> -<p>Then you can compile and run the sample programs without the class-path -option. + +<p>Otherwise, you can copy <tt>javassist.jar</tt> to the directory + +<ul><<i>java-home</i>><tt>/jre/lib/ext</tt>.</ul> + +<p><<i>java-home</i>> depends on the system. It is usually +<tt>/usr/local/java</tt>, <tt>c:\j2sdk1.4\</tt>, etc. <h3>2. sample/Test.java</h3> @@ -105,8 +116,8 @@ option. <p> To run, type the commands: <ul><pre> -% javac -classpath ".:javassist.jar" sample/Test.java -% java -cp ".:javassist.jar" sample.Test +% javac sample/Test.java +% java sample.Test </pre></ul> <p> For more details, see <a type="text/plain" href="sample/Test.java">sample/Test.java</a> @@ -121,13 +132,13 @@ option. <p> To run, type the commands: <ul><pre> -% javac -classpath ".:javassist.jar" sample/reflect/*.java -% java -cp ".:javassist.jar" javassist.reflect.Loader sample.reflect.Main Joe +% javac sample/reflect/*.java +% java javassist.reflect.Loader sample.reflect.Main Joe </pre></ul> <p>Compare this result with that of the regular execution without reflection: -<ul><pre>% java -cp ".:javassist.jar" sample.reflect.Person Joe</pre></ul> +<ul><pre>% java sample.reflect.Person Joe</pre></ul> <p> For more details, see <a type="text/plain" href="sample/reflect/Main.java">sample/reflect/Main.java</a> @@ -136,12 +147,12 @@ option. To do this, type the commands: <ul><pre> -% java -cp ".:javassist.jar" javassist.reflect.Compiler sample.reflect.Person -m sample.reflect.VerboseMetaobj +% java javassist.reflect.Compiler sample.reflect.Person -m sample.reflect.VerboseMetaobj </pre></ul> <p> Then, <ul><pre> -% java -cp ".:javassist.jar" sample.reflect.Person Joe +% java sample.reflect.Person Joe </pre></ul> <h3>4. sample/duplicate/*.java</h3> @@ -151,8 +162,8 @@ option. <p> To run, type the commands: <ul><pre> -% javac -classpath ".:javassist.jar" sample/duplicate/*.java -% java -cp ".:javassist.jar" sample.duplicate.Main +% javac sample/duplicate/*.java +% java sample.duplicate.Main </pre></ul> <p>Compare this result with that of the regular execution without reflection: @@ -170,13 +181,16 @@ This is a demonstration of the use of <tt>javassist.preproc</tt> package. <p> To run, type the commands: <ul><pre> -% javac -classpath ".:javassist.jar" sample/vector/*.java -% java -cp ".:javassist.jar" javassist.preproc.Compiler sample/vector/Test.j +% javac sample/vector/*.java +% java javassist.preproc.Compiler sample/vector/Test.j % javac sample/vector/Test.java % java sample.vector.Test </pre></ul> -<p>For more details, see +<p>Note: <code>javassist.jar</code> is unnecessary to compile and execute +<code>sample/vector/Test.java</code>. + +For more details, see <a type="text/plain" href="sample/vector/Test.j">sample/vector/Test.j</a> and <a type="text/plain" href="sample/vector/VectorAssistant.java">sample/vector/VectorAssistant.java</a> @@ -186,8 +200,8 @@ and <a type="text/plain" href="sample/vector/VectorAssistant.java">sample/vector <p> To run, type the commands: <ul><pre> -% javac -classpath ".:javassist.jar" sample/rmi/*.java -% java -cp ".:javassist.jar" sample.rmi.Counter 5001 +% javac sample/rmi/*.java +% java sample.rmi.Counter 5001 </pre></ul> <p> The second line starts a web server listening to port 5001. @@ -200,7 +214,7 @@ with a web browser running <p> Otherwise, run sample.rmi.CountApplet as an application: <ul><pre> -% java -cp ".:javassist.jar" javassist.web.Viewer localhost 5001 sample.rmi.CountApplet +% java javassist.web.Viewer localhost 5001 sample.rmi.CountApplet </pre></ul> <h3>7. sample/evolve/*.java</h3> @@ -211,8 +225,8 @@ with a web browser running <p> To run, type the commands: <ul><pre> -% javac -classpath ".:javassist.jar" sample/evolve/*.java -% java -cp ".:javassist.jar" sample.evolve.DemoLoader 5003 +% javac sample/evolve/*.java +% java sample.evolve.DemoLoader 5003 </pre></ul> <p> The second line starts a class loader DemoLoader, which runs a web @@ -42,6 +42,24 @@ </javac>
</target>
+ <target name="sample" depends="compile">
+ <javac srcdir="${basedir}"
+ destdir="${build.classes.dir}"
+ debug="on"
+ deprecation="on"
+ optimize="off"
+ includes="sample/**">
+ <classpath refid="classpath"/>
+ </javac>
+ <copy file="sample/vector/Test.j"
+ todir="${build.classes.dir}/sample/vector"/>
+ <copy todir="${build.classes.dir}/sample/evolve">
+ <fileset dir="sample/evolve"/>
+ </copy>
+ <echo>To run the sample programs, change the current directory
+to ${build.classes.dir}.</echo>
+ </target>
+
<target name="jar" depends="compile">
<jar jarfile="javassist.jar">
<fileset dir="${build.classes.dir}">
diff --git a/src/main/javassist/rmi/package.html b/src/main/javassist/rmi/package.html index 9f613666..5432a948 100644 --- a/src/main/javassist/rmi/package.html +++ b/src/main/javassist/rmi/package.html @@ -1,6 +1,6 @@ <html> <body> -Remote Method Invocation. +Sample implementation of remote method invocation. <p>This package enables applets to access remote objects running on the web server with regular Java syntax. diff --git a/src/main/javassist/web/package.html b/src/main/javassist/web/package.html index 2204efe9..3d5c6393 100644 --- a/src/main/javassist/web/package.html +++ b/src/main/javassist/web/package.html @@ -1,6 +1,6 @@ <html> <body> -Web server. +Simple web server. <p>This package provides a simple web server for other packages. </body> diff --git a/tutorial/tutorial2.html b/tutorial/tutorial2.html index 13574c96..9655844e 100644 --- a/tutorial/tutorial2.html +++ b/tutorial/tutorial2.html @@ -89,6 +89,16 @@ machine specification. The users must have the knowledge about class files and bytecode. For more details, the users should see the <code>javassist.bytecode</code> package. +<p>The class files modified by Javassist requires the +<code>javassist.runtime</code> package for runtime support +only if some special identifiers starting with <code>$</code> +are used. Those special identifiers are described below. +The class files modified without those special identifiers +do not need the <code>javassist.runtime</code> package or any +other Javassist packages at runtime. +For more details, see the API documentation +of the <code>javassist.runtime</code> package. + <p><br> <h3>5.1 Inserting source text at the beginning/end of a method body</h3> |