Where are my java files? in project view?

已回答

So, I'm going crazy here. This is day 2 of me trying to get a simple spring boot app working on intellij. I had tried the springinitializer wizard. The problem was that, all of a sudden, my .java files, and folder, disappeared from the project view. So I decided the best thing to try was to create a maven project, through the wizard, accepting all defaults; then copy my pom.xml dependencies from my failed spring boot wizard, then, hey presto, I'd have a spring boot app. The next thing I know, I'm seeing the same behaviour, namely, I can't view a 'java' folder in my project view. Then when I attempt to view the file in my terminal, the path shows me that the file TheClass.java is actually in the 'test' folder.

Look, I need to get a spring boot project working with intellij today, please help --that 'frttt.txt' file was just some sanity checking I was doing.

0

further to this, if I try to create a 'java' folder [right-click>new>folder], it complains that one such folder already exists. Where is it?

0

Maybe it's unrelated, but if I create any project via the maven wizard. I get the following strange structure, the 'java' folder is located both at the 'src', and again, within the 'main' folder.

0

I'm starting to worry if AppCode is the correct category for this. Whatever that is. You call yourselves a community?

0

And, likewise, any new project I attempt to create with the spring initializer, contains no java folder, in the project view, despite it having been generated, as you can see, in the terminal view.

 

0

>I can't view a 'java' folder in my project view. 

You have the project root directory marked as a source root type (see about Folder categories) for some reason. I can not reproduce it when creating a project via Spring Initializr wizard. Looks like you manually marked it by accident, or do you have some related configuraiton in Maven pom.xml for source roots? Note that in case of a Maven project IDE takes configuration like project structure about source/resource folders and dependencies from Maven pom.xml file.

Un-mark the project root directory as a source root or create new project via wizard so that it create correct project structure for you.

0

hi, i have exactly the same situation here.

i wish i knew but don't know how this happened, all i know is in project explorer, java files were missing but class files were there instead. Clicking on any of them opens class file. so i removed .class files. now nothing remained in there. But when i change to packages view, i can see java files.

Here is the images.

in project view;

in packages view;

 

Also, searching shows my missing classes;

0

Yildiz Hasan19 It looks like source roots are not configured correctly. See https://stackoverflow.com/a/43319356/104891. If the project is Maven or Gradle based, you can try to delete .idea directory and re-import it from the build file: https://www.jetbrains.com/help/idea/maven-support.html#maven_import_project_start.

0

请先登录再写评论。