Clearing non-project file syntax error in Zed
11:12 16 Dec 2025

I'm new to both the Zed IDE and Java and am getting the classic is a non-project file, only syntax errors are reported (Java 16) syntax error. I've found a lot of resources and options to try on VSCode but none specifically for Zed. It is not breaking anything when I run my programs but it is annoying. My settings.json is below:

{
  "languages": {
    "Java": {
      "language_servers": ["jdtls"],
      "formatter": "language_server"
    }
  },
  "lsp": {
    "jdtls": {
      "initialization_options": {
        "workspaceFolders": [
          // This tells JDTLS to treat the 'src' directory as the source root
          "file://$ZED_WORKTREE_ROOT/src"
        ],
        "settings": {
          "java": {
            "project": {
              "resourceFilters": ["bin"]
            }
          }
        }
      }
    }
  }
}

I'm using Maven to manage things. Here's my pom.xml as well:



  4.0.0

  com.princeton.algorithms
  algorithms-course
  1.0-SNAPSHOT

  algorithms-course
  
  http://www.example.com

  
    UTF-8
    17
  

  
    
      
        org.junit
        junit-bom
        5.11.0
        pom
        import
      
    
  

  
    
      org.junit.jupiter
      junit-jupiter-api
      test
    
    
    
      org.junit.jupiter
      junit-jupiter-params
      test
    
    
        edu.princeton.cs
        algs4
        1.0.0
    
  

  
    
      
        
        
          maven-clean-plugin
          3.4.0
        
        
        
          maven-resources-plugin
          3.3.1
        
        
          maven-compiler-plugin
          3.13.0
        
        
          maven-surefire-plugin
          3.3.0
        
        
          maven-jar-plugin
          3.4.2
        
        
          maven-install-plugin
          3.1.2
        
        
          maven-deploy-plugin
          3.1.2
        
        
        
          maven-site-plugin
          3.12.1
        
        
          maven-project-info-reports-plugin
          3.6.1
        
      
    
  

java zed