Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Move to use JDK 8 as the build JDK #959

Closed
bjhargrave opened this issue Nov 28, 2014 · 5 comments
Closed

Move to use JDK 8 as the build JDK #959

bjhargrave opened this issue Nov 28, 2014 · 5 comments
Milestone

Comments

@bjhargrave
Copy link
Member

We currently build bndtools with JDK 7. See the .travis.yml file for example. When building with JDK 8, there are some warnings and one compiler error. These need to be fixed so was can change .travis.yml and cloudbees to build bndtools with JDK 8.

@The-Alchemist
Copy link

For the curious, this is only error when building against Java 8:

/home/travis/build/The-Alchemist/bndtools/bndtools.core/src/bndtools/refactor/PkgRenameParticipant.java:55: error: cannot access IJavaElementMapper
        if (((RenamePackageProcessor) this.getProcessor()).getRenameSubpackages())
                                                          ^
  class file for org.eclipse.jdt.core.refactoring.IJavaElementMapper not found

@dhumeniuk
Copy link

I thought the JDK was supposed to support building for older versions. I see the build.bnd has:

javac.source: 1.6
javac.target: 1.6

I'm curious why this doesn't work.

@bjhargrave
Copy link
Member Author

I'm curious why this doesn't work.

Me too. Which is why we have this issue :-)

I am concerned there may be some type accessibility issue in the older version of Eclipse (3.7.2) we target for bndtools. Moving to a more recent version of Eclipse might be the solution.

@bjhargrave bjhargrave added this to the Someday milestone Feb 20, 2015
bjhargrave added a commit to bjhargrave/bndtools that referenced this issue Feb 28, 2015
Solves compilation errors mentioned in
bndtools#959

The `classycle` task fails when compiled with Java 8. Some code
compiled with Java 7 passes classcyle, so perhaps this is a classycle
bug? Use `gradle -x classycle` to build with Java 8.

Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
@bjhargrave
Copy link
Member Author

I fixed the compilation errors with Java 8. However with java 8 the classycle task fails. @njbartlett, what is the purpose of this task? Can we remove it from the build? You can use gradle -x classycle to build without using the classycle task.

@bjhargrave bjhargrave modified the milestones: 3.0, Someday Mar 9, 2015
@bjhargrave
Copy link
Member Author

Classycle is broken on Java 8 class files just like bnd was by the addition of compile-time constant entries in the constant pool. See http://blog.bjhargrave.com/2014/04/java-8-bnd-and-references-to-compile.html. I verified that when bndtools is built with JDK 7, the classycle check will pass when run on JDK 7 or 8 and also that when bndtools is built with JDK 8, the classycle check will fail when run on JDK 7 or 8. So this indicates that the issue is in the generated class files which is why I believe that the compile-time constants in the constant pool is causing classycle to report a false positive.

I sent an email to the classycle developer to inquire about a possible fix for classycle. If we cannot get a fix, we wont be able to use classycle when we move to build with JDK 8.

bjhargrave added a commit to bjhargrave/bndtools that referenced this issue Mar 9, 2015
It is broken when compiling with JDK 8. See
bndtools#959 (comment)

If we need any checks, @pkriens suggests we enhance bnd to make the
desired checks since it already parses the class files.

Signed-off-by: BJ Hargrave <bj@bjhargrave.com>
@bjhargrave bjhargrave modified the milestones: 3.1, 3.0 May 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants