My src in Java Resources suddenly disappear - java

Im creating a Dynamic Web Project, and I have src in my Java Resources then suddenly src disappear inside of it. I find out that the src became a context folder in the root along with Java Resources, Build, WEB-INF and WebContent folders. Why this happened. Sorry for bad grammar. Thanks in advance.

Verify your java build path of the project and check if src is present there.
Right click on the project and select Build Path -> Configure Build Path.If src is not in build path it won't show you can add src folder in your build path of the project by following below steps,
right click on project
select properties
select java build path
goto source tab
click add folder
select your source folder (src/main/java)
Also look at perspective is will be in Navigator perspective.

In your IDE goto Windows-> Show View -> Navigator, check the image for the same try to change it to "navigator" view your will be able to see it. If not please share the images of it, then we will help you more

#msagala you have to Configure build path. Then under Source tab click Add button and you will see your existing source folder.
I hope this will help you.

Related

Package and HTML editor issue with Eclipse and Gradle

I have created a gradle project in Eclipse and want to make it a web app. So I added the packages src/main/resources and src/main/webapp.
The thing now is that they wont show up in the project explorer.
My first question, how do I see my packages?
I can see the file inside the src directory, but then when I add a file index.html inside the src/main/webapp directory, it wont show up innside the editor window it starts running as a html document. How do I fix this?
In project explorer you might have checked empty packages.
Check the flag and make it unchecked as shown:
And the open html settings:
See associations:

How do I designate a folder as a Source folder by default in IntelliJ IDEA?

I have a somewhat atypical folder structure where my java sources are in 2 different source folder,
src/main/java
src/main/some-generated-code
IntelliJ does not recognize some-generated-code as a source folder and this obviously leads to all sorts of red-warnings in the IDE.
One way to fix this obviously is to go to the Project explorer right click on some-generated-code and "Mark Directory As Sources". This works fine. However I have multiple projects with the same structure and I was wondering if it is possible to by default have any folder with the structure src/main/some-generated-code designated as a "Source" folder.
Do this:
-Right click on the project in Intellij
-Click on "Open Module Settings"
-You'll see something like the below image.
-To assign a folder as a source, click on it and then click Sources
-

source folders not visible in Netbeans project after installing jRebel plugin?

I installed jRebel on Netbeans 7.4 beta one day, the next day all my source folders an libraries to disappeared from my projects - except Maven ones. Like this:
The source folders are still present on my drive:
I just need to restore their visibility in my opened Netbeans projects.
When I try to add source packages from the "Properties" menu of the project, I do get the source back but as folders, not packages.
Help would be much appreciated!
Try going to Files view in Neteans, and look under the src folder in your project. Does the src folder have a sub-folder named java?
If not, create it (right click on src, go to New, select Folder). Your source packages should re-appear in the project view.
This is for Netbeans 8.0. I am not sure if it is available for other versions.
Right click on the project -> Set Configuration -> Customize -> Sources -> Add Folder for Sources Packages Folder -> Select folders you want to see under your project -> OK
Netbeans version 8:
In files tab, go to main folder and create a folder called java. That's it!

Eclipse does not show lib directory during Java Build Path -> Libraries editing

I have an Eclipse/Java project (Eclipse 3.5.2) that I am trying to add some JARs to. In the root project directory I have 3 sub-directories, src, bin, and lib and all 3 sub-directories are present in the Package Explorer list. I put the needed JARs into lib. However, when I go to Project Propertes -> Java Build Path -> Libraries (tab) -> Add JARs, and the file dialog comes up, it only shows the src and bin directories in the file picker, not the lib directory. I'm guessing it is something really simple, but can someone tell me why the file picker dialog doesn't show the lib directory?
-- roschler
After you copy a jar file to your lib folder, you need to refresh the project in Eclipse (use F5) so Eclipse knows about it.
It will then show you the lib folder in that dialog.
Note: You are correct in your answer that the said dialog doesn't reread the directory structure, but you are missing the point - it is not supposed to. That's what you have "add external jar" for. Further more, Eclipse is trying to be smart and not show you jars that you have already added (think about a folder with 50 jars and you just want to add one). That's why it didn't show you the lib folder - it thought the folder was empty.
This is to help others. I had to do File -> Refresh to get Eclipse to see the files. Apparently file picker dialogs do not reread the disk structure. I guess they are pulling from Eclipse's main file directory image which has to be refreshed before new files are visible anywhere else in the program.
This is how I resolved this problem.
I created a lib folder in my java project.Then I added some jar to lib folder.
But it doesn't appear in my eclipse IDE.Then I selected my project and right clicked on it. Then refreshed.
It works for me. I think this will help you.

Eclipse Java Missing required source folder: 'src'

I imported a jar file into workspace and this is the error I get:
Description Resource Path Location Type
Project 'Interpreter1' is missing required source folder: 'src' Interpreter1 Build path Build Path Problem
How can i get rid of this error?
Right-Click Project --> Build Path --> Configure Build Path; unselect the SRC, save, select again.
This solved my problem.
Go to the Build Path dialog (right-click project > Build Path > Configure Build Path) and make sure you have the correct source folder listed, and make sure it exists.
The source folder is the one that holds your sources, usuglaly in the form: project/src/com/yourpackage/...
Right Click Project -> New -> Folder -> Folder Name: src -> Finish
Here's what worked for me: right click the project-> source -> format
After that just drag and drop the source folder into eclipse under the project and select link.
good luck!
Edit your .classpath file. (Or via the project build path).
Right-Click Project --> Build Path --> Configure Build Path-->source-->(Select missing folder or path)-->Add Folder-->Apply-->Ok
Create the src folder in the project.
I was confused by this for hours.
Right click on project -> Build Path -> Configure Build Path -> Add Folder
One of the build path issue is it cannot find the correct /src/conf source folder. Right click on each project, Build Path > Configure Build Path. Under the Source tab, remove the folder with a red cross icon on the bottom right. It will work for the situation that there is a small red exclamation mark “!“ bedore your project name!
In eclipse, you must be careful to create a "source folder" (File->New->Source Folder). This way, it's automatically on your classpath, and, more importantly, Eclipse knows that these are compilable files. It's picky that way.
If you are facing an error with the folder, such as src/test/java or src/test/resources, just do a right click on the folder and then create a a new folder with the name being src/test/java. This should solve your problem.
I think it's because of the .classpath getting saved with the deleted source folder configuration.
Create the missing folder [ 'src' in your case] manually inside the root of the project. When I say manually, I meant outside Eclipse, using the file explorer.
Then, come back to eclipse and refresh the project. Now, the error saying it's already there will be gone.
Now, Right click on the project > Build Path > Configure Build path. It should take us to the Java build path side menu.
Make sure we are on the 'Source' tab. Delete the source folder causing the problem. Now, maybe the folder might show up in the project structure and you may delete that too.
Eclipse wouldn't let me point to an existing (or add a new) source directory.
Eclipse's configuration files can be wonky. In my case I should have started simple. Right click the project and click Refresh.
In my case eclipse reported this in the Problems view on the parent project which does not have any code. I just delete the error whenever it is reported on this parent project where src folder is really not needed.

Categories