[JSR308] NoSuchFieldError: RELEASE_7 on Mac

Mathias Ricken mgricken+jsr308 at gmail.com
Mon Sep 22 11:02:48 EDT 2008


Hi everyone:

I'm trying to use the prototype compiler and the checker framework on
my MacBook with MacOS 10.4.11, but whenever I try to run a checker,
such as the NullnessChecker, I get the following exception:

% javac -processor checkers.nullness.NullnessChecker Test.java

An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.NoSuchFieldError: RELEASE_7
       at checkers.source.SourceChecker.getSupportedSourceVersion(SourceChecker.java:631)
       at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.checkSourceVersionCompatibility(JavacProcessingEnvironment.java:502)
       at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:475)
       at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:568)
       at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:654)
       at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:812)
       at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1022)
       at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:768)
       at com.sun.tools.javac.main.Main.compile(Main.java:386)
       at com.sun.tools.javac.main.Main.compile(Main.java:312)
       at com.sun.tools.javac.main.Main.compile(Main.java:303)
       at com.sun.tools.javac.Main.compile(Main.java:82)
       at com.sun.tools.javac.Main.main(Main.java:67)

The versions of javac and java that I am running are as follows:

javac 1.7.0-jsr308-0.7.7

java version "1.6.0_03-p3"
Java(TM) SE Runtime Environment (build
1.6.0_03-p3-landonf_19_aug_2008_14_55-b00)
Java HotSpot(TM) Server VM (build
1.6.0_03-p3-landonf_19_aug_2008_14_55-b00, mixed mode)

Perhaps I did something wrong during the build process, so please let
me explain what I did:

- I downloaded soylatte16-i386-1.0.3.tar.bz2 and set up my path so the
SoyLatte compiler would be used
- I edited the build.properties file so that boot.java.home points to SoyLatte
- I did an ant clean build-javac build-javap inside the make
directory, and Ant compiled successfully
- Now I made a copy of SoyLatte, to serve as installation target for
the JSR 308 prototype compiler
- I copied javac.jar and javap.jar from dist/lib into binary
- I set JAVA_HOME to point to the copy of SoyLatte
- I did an ant install, which processed was successful
- I put checkers.jar on the classpath.

When I set my path and JAVA_HOME to use the modified copy of SoyLatte,
I can now use the JSR 308 compiler.  When I try to use the
NullnessChecker, however, I get the above exception.

I checked that the tools.jar file in the modified SoyLatte contains
the javax.lang.model.SourceVersion.RELEASE_7 field, and it does. But
it seems like somehow Java doesn't find the right tools.jar.

Can someone point out what I did wrong?
Thank you in advance, I am looking forward to hearing from you.


Mathias Ricken



More information about the JSR308 mailing list