Bug 30984 - Add an ability to compile JSPs to specified target JVM
Summary: Add an ability to compile JSPs to specified target JVM
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 5.0.28
Hardware: All other
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-01 08:45 UTC by Dominik Drzewiecki
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Drzewiecki 2004-09-01 08:45:08 UTC
I installed Tomcat 5.0.28 on W2K box. During installation I provided path to
j2sdk 5.0 beta 3 build 60, therefore tools.jar has been taken from this
particular distro. After that I had been forced to switch JVM to IBM's 1.4.1
(WebSphere 5.1 AppClient). Tomcat starts with no problem, however, Jasper
compiles JSP with javac from tools.jar (jvm 5.0 compliant) and makes compiled
classes unusable for the 1.4.1 jvm. 

The simplest workaround is to overwrite tools.jar with the one that comes with
the jdk that tomcat is run on.  However, the simple solution is to provide the
"target" parameter to JspServlet and pass it along to ant javac compiler. 

...Yes, I know we're going to get rid of ant compiler... ;) BTW, I wonder which
version of classes JDT will produce. Maybe this also should be up to the user to
decide?
Comment 1 Yoav Shapira 2004-09-02 16:10:07 UTC
OK, added compilerTargetVM option to JspServlet and JspC.
Comment 2 Dominik Drzewiecki 2004-09-03 10:36:13 UTC
Based on mu recent experience, javac params source and target are interrelated.
For example, the default source version for the 5.0 RC b63 is 1.5 which implies
1.5 as a target. For example using ant 1.6.2 on j2sdk1.5 (hell, cannot get used
to switching to 5.0, either can Sun, I suppose ;) the following

<javac target="1.4" ... /> 

results in:

 [javac] javac: target release 1.4 conflicts with default source release 1.5

Providing source attribute to ant's javac task forces compiler to downgrade to
1.4 sources.

<javac target="1.4" source="1.4" ... /> 

I'd be more than delighted if you could also provide the source parameter in the
same manner as you have done with the compilerTargetVM. BTW, I have no idea if
this also affects JDT. 
Comment 3 Remy Maucherat 2004-09-03 11:04:24 UTC
We're waiting for your patches :)
Comment 4 Yoav Shapira 2004-09-03 17:55:13 UTC
Yes, this also affects JDT.  And please do NOT reopen one issue to ask for 
something else to be done, even if it's related.
Comment 5 Dominik Drzewiecki 2004-09-04 07:21:14 UTC
The reason why I reopened was the fact that the solution you provided
*partially* works. What I wanted to point out is the fact that the "target"
parameter alone seems not to be sufficient. Sorry for reopening but I still
consider adding "source" parameter is essential for this very enhancement to be
fully functional. My bad I haven't indicated it in my initial submission.