Hi
We've added initial support for Java 1.5 compilation: the JDT compiler
jar has been upgraded to 3.1.1 and JR or system properties specify
whether 1.5 compilation should be perfomed (as suggested by Havier).
There is a sample that shows how 1.5 compilation can be used.
To be noted that some things (like generic types for
parameters/variables) are not yet supported.
Regards,
Lucian Chirita
Xavier Frisaye wrote:
Thanks again for replying.
It works only when i use the 3 parameters related to jdk version :
settings.put(CompilerOptions.OPTION_Compliance,
CompilerOptions.VERSION_1_5);
settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5);
settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_1_5);
But for more usability (working with system properties), I made this patch to
JRJdtCompiler at line 301 :
Enumeration systemPropertiesName =
System.getProperties().propertyNames();
while (systemPropertiesName.hasMoreElements())
{
String systemPropertyName = (String)
systemPropertiesName.nextElement();
String systemPropertyValue = (String)
System.getProperties().get(systemPropertyName);
if ( systemPropertyName.startsWith("org.eclipse.jdt.core.compiler")
&&
systemPropertyValue != null && systemPropertyValue.length() > 0)
{
log.info("Adding system property \"" + systemPropertyName +
"\" with value \"" + systemPropertyValue + "\" to compiler
settings map");
settings.put(systemPropertyName,systemPropertyValue);
}
}
Is-it possible to make similar functionality in future release?
Of course, only if the community think it could be useful and it was not done
yet. ;-)
Regards,
Xavier Frisaye
-----Original Message-----
From: Lucian Chirita [mailto:[EMAIL PROTECTED]
Sent: lundi 3 octobre 2005 17:21
To: [email protected]
Subject: Re: [jasperreports-questions] Jdt-Compiler + Java 1.5
You can also set
settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_1_5);
if you want 1.5 class files generated..
Lucian Chirita wrote:
Hi
If you want to use 1.5 code in your report, you'll have to set the
following option when compiling the report (in JRJdtCompiler.java):
settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_1_5);
Regards,
Lucian
Xavier Frisaye wrote:
Thanks a lot for your reply.
Your patch seems to work but i'm encountering another problem, i have
the same auto-boxing compilation error than with the non 3.1
jdt-compiler :
Caused by: net.sf.jasperreports.engine.JRException: Errors were
encountered when compiling report expressions class file:
1. Cannot cast from boolean to Boolean
value = (java.lang.Boolean)(true);
<----------------------->
2. Cannot cast from boolean to Boolean
value = (java.lang.Boolean)(true);
<----------------------->
3. Cannot cast from boolean to Boolean
value = (java.lang.Boolean)(true);
<----------------------->
3 errors
Is there a way (sys property or any) to activate Java 1.5 compilation
in Jdt-Compiler?
Best regards,
Xavier
-----Original Message-----
From: Lucian Chirita [mailto:[EMAIL PROTECTED]
Sent: lundi 3 octobre 2005 15:07
To: [email protected]
Subject: Re: [jasperreports-questions] Jdt-Compiler + Java 1.5
Hi Xavier
The following patch ensures support for the 3.1 Jdt compiler:
http://sourceforge.net/tracker/index.php?func=detail&aid=1233072&group_id=36382&atid=416705
JRJdtCompiler rev 1.12 supports both the 3.1 compiler and the one
distributed with JasperReports. This is part of the 1.0.0 release.
If upgrading to 1.0.* is not an option, you could apply the patch to
the 0.6.7 sources and use the 3.1 compiler.
HTH,
Lucian
Xavier Frisaye wrote:
Hi all,
I'm using Jasper Reports 0.6.7 with Java 1.5 and JavaC for template
compilation .
But i would try to use jdt compiler instead of JavaC but it doesn't
work with Java 1.5 (autoboxing compilation error).
I also try the lastest jdt compiler from Eclipse (3.1.0) but it
seems its api has changed and it is no more compatible with Jasper
0.6.7.
Am i missing something?
Does anyone have this problem?
Regards,
Xavier Frisaye
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads,
discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jasperreports-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jasperreports-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jasperreports-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
jasperreports-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions