Source Folder Is Not on the Java Build Class Path, Creating Java Package

Source folder is not on the Java build class path, creating Java package

Do it from the context menu of the "src" folder itself. The "Source folder" literally means a Source Folder as designated in the Java Build Path, not just some folder that happens to contain source. The Name field wants the actual, proper in the "this is what a .java file in it would declare", qualified package name. If you just wanted to create a new folder in there to then make some new .java files, you can just use the New Folder wizard.

EDIT: Also, keep in mind that the Package Presentation setting (set from the view's local menu--the upside down triangle) might be different between the Project and Package Explorer views. Adjust as you see fit if things look the opposite of how you'd like.

Source folder is not a Java project error in eclipse

In the maven project directory try

mvn eclipse:eclipse

that may do the trick.

Eclipse, Java from 2 src. folders?

I have tried same thing and its working for me.

See be tutorial Organizing sources

make sure setting is same as below:

enter image description here

Eclipse+Maven src/main/java not visible in src folder in Package Explorer

Eclipse filters out folders that are marked as source from the "raw" folder path. That is, they are visible only as source folders:

example project

If you can't see them in either place, then they

  • are either filtered out in the settings: check your settings for Package Explorer (the Package Explorer bar, downwards menu arrow -> Filters...)
  • or they were created externally and Eclipse haven't noticed them: Refresh your project in this case.
  • or they don't exist: right-click on the project, select New->Folder and input the path, e.g. src/test/java (not "Source Folder"). After you use Maven->Update Project... on the project, they will be automatically added as source folders, provided you have the default configuration.

Now, as I said, those folder will only be used as source if you preserved the default configuration in your POM. If you defined other resources and/or testResources, those will be used instead. In general, Eclipse m2e synchronizes Eclipse's project source folder configuration with what's in your POM.

EDIT: maybe this is unclear - see those folders at the top? The ones labeled with the /-separated paths? These are your folders. These are the same folders that you would expect to find in main and test, just represented differently.

eclipse source folder is not java project, after importing project from git

If mvn eclipse:eclipse does not work, you can try and specify manually the src folder, which will be recorded in the .project.

Check first if "Convert to Faceted Form" / Java would be enough.



Related Topics



Leave a reply



Submit