BruceEckel / TIJ4-code

Example code for the book "Thinking in Java, 4th Edition"
Other
842 stars 469 forks source link

Build fails on JDK 1.8 #2

Open aoles opened 6 years ago

aoles commented 6 years ago

Hi there, I get the following error when building with JDK 1.8. Adding tools.jar to CLASSPATH didn't help, any suggestions are highly appreciated. Thanks!

    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessor.java:7: error: package com.sun.mirror.apt does not exist
    [javac] import com.sun.mirror.apt.*;
    [javac] ^
    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessor.java:8: error: package com.sun.mirror.declaration does not exist
    [javac] import com.sun.mirror.declaration.*;
    [javac] ^
    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessor.java:13: error: cannot find symbol
    [javac]   implements AnnotationProcessor {
    [javac]              ^
    [javac]   symbol: class AnnotationProcessor
    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessor.java:14: error: cannot find symbol
    [javac]   private final AnnotationProcessorEnvironment env;
    [javac]                 ^
    [javac]   symbol:   class AnnotationProcessorEnvironment
    [javac]   location: class InterfaceExtractorProcessor
    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessor.java:15: error: cannot find symbol
    [javac]   private ArrayList<MethodDeclaration> interfaceMethods =
    [javac]                     ^
    [javac]   symbol:   class MethodDeclaration
    [javac]   location: class InterfaceExtractorProcessor
    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessor.java:18: error: cannot find symbol
    [javac]     AnnotationProcessorEnvironment env) { this.env = env; }
    [javac]     ^
    [javac]   symbol:   class AnnotationProcessorEnvironment
    [javac]   location: class InterfaceExtractorProcessor
    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessorFactory.java:4: error: package com.sun.mirror.apt does not exist
    [javac] import com.sun.mirror.apt.*;
    [javac] ^
    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessorFactory.java:5: error: package com.sun.mirror.declaration does not exist
    [javac] import com.sun.mirror.declaration.*;
    [javac] ^
    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessorFactory.java:9: error: cannot find symbol
    [javac]   implements AnnotationProcessorFactory {
    [javac]              ^
    [javac]   symbol: class AnnotationProcessorFactory
    [javac] /Users/oles/Projects/TIJ4-code/examples/annotations/InterfaceExtractorProcessorFactory.java:11: error: cannot find symbol
    [javac]     Set<AnnotationTypeDeclaration> atds,
    [javac]         ^
    [javac]   symbol:   class AnnotationTypeDeclaration
    [javac]   location: class InterfaceExtractorProcessorFactory
    [javac] 10 errors
chernbo commented 5 years ago

try again

edenpan commented 4 years ago

Maybe too late, I tried to download an apt jar from apt-mirror-api-0.1.jar and it works.