After I have found information from web.
I found that Jasper,Jikes, ant are all can be used to compile source.
But, What they are different?
Which is better for beginner?
I have tried to download the jikes and have finished reading the manual. But, I am also confusing about how to use it.
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/printer/jasper-howto.html#Introduction
I am trying develop a project in the windows environment now.
I am look forward to receiving your reply. Thanks
Discussions
Web tier: servlets, JSP, Web frameworks: How To Compile the Java Source into Class File in Struts
-
How To Compile the Java Source into Class File in Struts (3 messages)
- Posted by: Hoi Yan ng
- Posted on: November 21 2003 23:19 EST
Threaded Messages (3)
- Compiling struts classes by sgt pepper on November 24 2003 10:52 EST
- Compiling struts classes by Hoi Yan ng on November 28 2003 17:16 EST
- Compiling struts classes by Hoi Yan ng on November 28 2003 05:21 EST
- Compiling struts classes by Hoi Yan ng on November 28 2003 17:16 EST
-
Compiling struts classes[ Go to top ]
- Posted by: sgt pepper
- Posted on: November 24 2003 10:52 EST
- in response to Hoi Yan ng
The good news is you can compile struts .java files with any standard java compiler(eg:jikes). But beware, you should have the struts jars as well as your servlet implementation(provided by tomcat or whatever servlet container that you use) jars in your classpath.
so, you may write a shell script or .bat file to set all required jars in your CLASSPATH. and then invoke "javac" on your sourcefiles.
But the most elegant, standard and useful way is to use ANT. The following is an eg: ANT build.xml target for compiling struts java files.
<!-- to compile the java files in web-inf/classes -->
<target name="compile" depends="prepare" description="to compile java files">
<path id="classpath">
<!-- in following directory, there is struts.jar and commons-*.jar-->
<fileset dir="./web/WEB-INF/lib" includes="*"/>
<!-- I use weblogic's servlet impl -->
<fileset dir="${j2ee.dir}" includes="weblogic.jar"/>
</path>
<javac srcdir="./web/src"
destdir="./web/WEB-INF/classes">
<classpath refid="classpath"/>
</javac>
</target
This may look a bit confusing to you if you dont know ANT, but it is easy to learn and more easy to use. -
Compiling struts classes[ Go to top ]
- Posted by: Hoi Yan ng
- Posted on: November 28 2003 17:16 EST
- in response to sgt pepper
Thanks for your help.
I have another problem again, hope you can help.
I have tried to use eclipse which having the ant.I can generate the .class already.
However, there are still some problems which I don't know how to solve.
This is the printscreen of my situation.
http://hk.geocities.com/daisy_sina/q.JPG
Some of the java file still have the problem of "!", but I don't know what it really means.
Look forward to receving your reply. thanks -
Compiling struts classes[ Go to top ]
- Posted by: Hoi Yan ng
- Posted on: November 28 2003 17:21 EST
- in response to Hoi Yan ng
sorry, I don't know why the hyperlink is not work.
But, if you copy and paste the address to a browser, then it will be OK.