Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5957509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:24:37+00:00 2026-05-22T18:24:37+00:00

[javac] C:\ws\galileo\test\Cacheable.java:13: incompatible types [javac] found : com.io.CacheType [javac] required: com.io.CacheType [javac] public CacheType

  • 0
[javac] C:\ws\galileo\test\Cacheable.java:13: incompatible types
[javac] found   : com.io.CacheType
[javac] required: com.io.CacheType
[javac]  public CacheType id() default CacheType.COMMON;

I really don’t get this one.
I have a project where I’m custom building a caching interceptor for Spring. It simply is a look by cache name to point to EhCache and uses aop-autoproxy to load the CacheableAspect (which is my caching intercepter). Now when I use the default value in the annotation, ANT gives me the compiler error below. I tried updating to the latest JDK (i’m on 1.6 16 now) and setting source/target levels in the ant script but no success. When I remove the default value and force all areas to specify a value, it compiles in ant fine.

It always worked in Eclipse, I had unit tests that ran perfectly with the previous default value.

What gives? I tried building a project (no spring) that simply echoed the configuration with ant and it compiled in ant fine (and in eclipse).

that tells me MAYBE it might be the spring auto-proxying somehow? but then why would the compiler not give me the generated type name? GRRRR. Any thoughts?

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.io.CacheType;

@Retention(RetentionPolicy.RUNTIME) 
@Target({ElementType.METHOD}) 
public @interface Cacheable {
 public CacheType value() default Cachetype.COMMON;
}

public enum CacheType {

 COMMON("common"),
 PERSISTENT("persistent";

 private String cache;

 CacheType(String cache) {
  this.cache = cache;
 }

 public String cache() {
  return this.cache;
 }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:24:38+00:00Added an answer on May 22, 2026 at 6:24 pm

    Still present in JDK 6u25, but adding package to default value does the trick:

    CacheType value() default com.io.CacheType.COMMON;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example: javac Foo.java Note: Foo.java uses unchecked or unsafe operations. Note: Recompile with
I was wondering about what makes the primary Java compiler (javac by sun) so
The Java static compiler (javac) inlines some static final variables and brings the values
Do java compilers (javac or eclipse) try to compile method calls as static when
I have installed the Java plugin for Eclipse Galileo on Windows. However, i don't
With the Galileo release it is finally possible to convert a normal Java project
1) Is it true that javac.exe is sun's implementation of a java compiler, 2)
I've run into a really weird situation. I'm doing the following in Java (through
http://download.oracle.com/javase/tutorial/java/javaOO/nested.html says that static nested classes should be accessed this way: OuterClass.StaticNestedClass nestedObject =
If I switch on the generating of debug info with Javac then the class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.