tags:

views:

16

answers:

1

Why does RAD7 give a compile error of

The constructor IOException(Exception) is undefined

on the following line

throw new IOException(ex);

The Javadoc for Java 1.6/6.0 states that IOException has a IOException(Throwable) constructor

When I look at the definition of IOException I see only the following constructors

  • IOException()
  • IOException(String)

Notes:

  • Rational Application Developer 7.0.0.8
  • Project Compatability set to Java 6
+1  A: 

This is caused by your project being set to compile against an older JRE.

If this is a "faceted project" (right-click the project -> properties, choose "Project Facets" if it exists), then your "Java" facet is probably not 1.6.

If this is not a "faceted project", go to the project's build-path and you'll see that it's compiling against a WAS 6.0 JRE which is JDK 1.4. Double-click it to change to WAS 7.0 JRE.

Isaac