Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New java created project not detected as java project until a file is opened #2541

Closed
rajinder-yadav opened this issue Jul 5, 2022 · 3 comments

Comments

@rajinder-yadav
Copy link

Newly created java project not detected as java project.

Create a new java project.

Steps:
press ctrl + shift + p
Type "java: create"
Selected, create a new java project.

Once project is created, notice IDE has not detected it is a java project.
open the main java file, now IDE detects it is a java project.

Issue with this, before opening any java file, if I right-click in explorer on "src" folder to create a new java file, IDE creates a blank file. It should create a file with skeleton code of a Class.

java

Environment
  • Operating System: Linux
  • JDK version: openjdk version "18.0.1" 2022-04-19
  • Visual Studio Code version: 1.69.0-insider
  • Java extension version: 1.8.0
@rajinder-yadav
Copy link
Author

The same happens if you cd in the root of the java project and then open vscode from the terminal.
vscode opens and doesn't know project is java.
note make sure no files are opened in edit window, if so close all open files, close vscode and redo steps.

@jdneo
Copy link
Collaborator

jdneo commented Jul 6, 2022

This is by design so far. For project which has build tools (pom.xml, build.gradle, etc...), the project will be imported automatically as long as those files are located at the root of the workspace folder.

For project which do not have a build tool (your case), the Java extension won't be activated until a Java file is opened. - to avoid being activated unintentionally.

@jdneo jdneo added the not-a-bug label Jul 6, 2022
@jdneo jdneo closed this as completed Jul 6, 2022
@gnuchanos
Copy link

not a bug it's a future
2023-10-29-223956_1165x451_scrot

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

No branches or pull requests

3 participants