Jump to content

How to choose a different compiler ?


ktrinad

Recommended Posts

By: Tide - lovetide

How to choose a different compiler ?

2006-07-18 03:28

I designed a report by iReport 1.2.5, and the report refer to some JDK 1.5 features, so I choose Java compiler as default compiler in iReport 1.2.5.

 

After I created report unit in JasperIntelligence, and run it, then JasperIntelligence throws an exception like the following:

 

Errors were encountered when compiling report expressions class file:

1. The method format(String, Object[]) in the type String is not applicable for the arguments (String, Long)

value = (java.lang.String)(String.format("%02d", ((java.lang.Long)field_Hour.getValue())) + ":" + (((java.lang.Long)field_HalfAnHour.getValue()).longValue()==0 ? "00" : "30"));

...........

...........

3 errors

 

 

String.format () method is JDK 1.5 feature, so it failed compiling, so can I choose Java compiler as the default compiler ?

 

Thanks !

 

 

By: Lucian Chirita - lucianc

RE: How to choose a different compiler ?

2006-07-18 04:02

JasperReports uses by default the Eclipse JDT compiler. To make this compiler work with Java 1.5 code, create a file named jasperreports.properties, place it somewhere on the application classpath (e.g. under $TOMCAT/webapps/jasperserver/WEB-INF/classes) and include the following properties in the file:

 

org.eclipse.jdt.core.compiler.source=1.5

org.eclipse.jdt.core.compiler.compliance=1.5

org.eclipse.jdt.core.compiler.codegen.TargetPlatform=1.5

 

If you want to use another compiler instead of the JDT one, you need to set this property (in the same file):

net.sf.jasperreports.compiler.class=compiler_class

 

HTH,

Lucian

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...