Skip to content

java: cannot find symbol symbol: class Generated location: package javax.annotation #4166

Description

@Nyagar-Abraham

The error "java: cannot find symbol symbol: class Generated location: package javax.annotation" indicates that the Java compiler cannot locate the Generated class within the javax.annotation package. This typically occurs in projects that use code generation or annotations and are missing a required dependency or have an incorrect project setup.

Here are the common causes and solutions:
Missing javax.annotation-api dependency.
The Generated annotation is part of the javax.annotation-api library. If your project uses a build system like Maven or Gradle, you need to explicitly add this dependency.

Maven

<dependency>
       <groupId>javax.annotation</groupId>
       <artifactId>javax.annotation-api</artifactId>
       <version>1.3.2</version> <!-- Or the appropriate version for your project -->
   </dependency>

Gradle

 dependencies {
       implementation 'javax.annotation:javax.annotation-api:1.3.2' // Or the appropriate version
   }

Activity

  1. changed the title [-]java: package org.springframework.data.repository.reactive does not exist[/-] [+]java: cannot find symbol symbol: class Generated location: package javax.annotation[/+] on Sep 22, 2025
  2. fbricon commented on Nov 12, 2025

    @fbricon
    Collaborator

    Can you explain what you expect from vscode-java in this situation?

  3. github-actions commented on Dec 12, 2025

    @github-actions

    This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions