Marshall Schor wrote: > > Thilo Goetz wrote: >> Thilo Goetz (JIRA) wrote: >> >>> Lucas: does not compile with Java 1.5 >>> ------------------------------------- >>> >>> Key: UIMA-1552 >>> URL: https://issues.apache.org/jira/browse/UIMA-1552 >>> Project: UIMA >>> Issue Type: Bug >>> Components: Sandbox-Lucas >>> Reporter: Thilo Goetz >>> Assignee: Thilo Goetz >>> Fix For: 2.3S >>> >>> >>> Lucas uses IOException constructors that are not in Java 1.5. >>> >>> >> This reminds me: Marshall, please remember to build our >> release with Java 1.5. Otherwise people may not be able >> to run our binaries with 1.5. Thanks. >> > hmmm, I think this is supposed to be automatic. IIRC, the way it is > supposed to work is the top level parent, uimaj/pom.xml, has java 1.5 > specified: > > <pluginManagement> > <plugins> > <!-- set Java 1.5 as the source and target of compilation --> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <configuration> > <source>1.5</source> > <target>1.5</target> > <encoding>UTF-8</encoding> > </configuration> > </plugin> > > The eclipse:eclipse maven plugin which generates the Eclipse stuff from > the POMs, takes this and sets 1.5 in the ".settings". file for the > Eclipse project. > > Any idea what is going wrong? -Marshall
What this switch controls (and this is true in Eclipse as well) is the language level and the class file level. I.e., this ensures that no new language features of 1.6 are used in the code. These are switches that the Java compiler itself offers, so this is easy to implement. What this switch does not control is the level of the libraries that you compile against. If you use Java 1.6 for compilation, it will contain 1.6 versions of the libraries. If there are new features in there, you can use those features, the 1.5 compiler switches notwithstanding. That's the issue we face here. So to be sure you're not compiling against _library_ features that are only available in 1.6, you will always need to compile with 1.5 anyway. In that sense, the source and target switches are misleading and not that useful, except for documentation purposes. --Thilo > > >> --Thilo >> >> >> >>