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!
Related
I'm using Netbeans IDE (Version 13) for Java development.
In the projects view Netbeans shows a tab for "Project Files". This usually contains files like pom.xml, settings.xml and nb-configuration.xml for an opened Java project.
Now I have added some custom files in the same folder directory as the aforementioned files, namely a Jenkinsfile.config as well as a lombok.config file.
I would like Netbeans to show these files under the "Project Files" tab for each project but until now I wasn't able to find a solution for this.
I already added the file type ".config" as a file association for Netbeans and associated it to the MIME type "Properties Files".
Now Netbeans recognizes the files (an even their contents) when in the "Files" view but they are still not shown anywhere in the "Projects" view.
Does anyone have any suggestions?
[EDIT]: Ideally I would prefer a solution that doesn't require installing any plugins from sources outside of Apache (or similar).
Maybe it is even possible to just configure Netbeans to show the desired behaviour.
You can download and install plugin readmeinprojectview, see here how.
Then go to Tools -> Options -> Miscellaneous -> Display more files. Add the files you need to show in the Project tab. In your case they are Jenkinsfile and lombok.
The plugin by default adds the following files to the project tab under the root project node. Without the plugin, NetBeans for Maven-based projects displays ONLY logical folders under the root project node i.e. "Source Packages" or "Project Files"...
Currently you cannot put the files you want under the "Project files" node. Here is the source code of NetBeans for Maven-based project types. As you can see under the "Project files" node goes the following files only:
pom.xml
nbactions.xml
Files that start with nbactions- and end with .xml
nb-configuration.xml
Maven's default settings.xml
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
-
How can I copy the Eclipse classpath variables from the open workspace to a new workspace? I am using Eclipse Juno (Eclipse Platform 4.2.1 and Eclipse Java Development Tools 3.8.2).
Try File -> Export -> General -> Preferences and export All. Next, import the preferences into your second workspace.
Classpath variables are stored in at least three places in eclipse:
Workspace level
These are effectively global, and can be seen in Preferences->Java->Build Path->Classpath variables. You could export these as with any other preferences, and import them to your new workspace.
Project level
Seen in the Project->Properties->Java Build Path editor. These are stored in the .classpath file in the project root. You could simply copy and paste relevant sections from one .classpath file to another if you want to avoid using the project properties editor.
Run configuration
These are classpath variables used to actually execute code from Eclipse, you can see them in Run->Run configurations->(select one)->Classpath tab. You can 'save' a configuration by going to the 'Common' tab and changing it from 'local' to 'shared', and then move that shared file whereever you care to.
Yes, there is no direct way to achieve this. I found a workaround solution.
Try the File System export, select only .classpath files for all the Projects you want to export and in the options select 'Create directory structure for files' to make sure each project classpath is generated in its own folder.
for using this to import, just copy-paste the exported files(containing only .classpath file) to the new workspace.
I had a corrupt workspace (due to svn collision).
I deleted the .metadata directory from the workspace, and then reloaded eclipse, and did an "import" of a project into the workspace.
However, the project got imported in a rather strange way -- all directories in the project appear, but the src/ directory does not have automatic compilation (when choosing a .java file) -- it is as if the src/ directory is not identified as a special directory.
Is there a way to fix that?
I also followed http://letsgetdugg.com/2009/04/19/recovering-a-corrupt-eclipse-workspace/, and that did not help either.
Switch to a new workspace.
Then go File -> Import -> Exsisting projects into workspace .
In the root folder text box , type the address of corrupted workspace.
Click Refresh .
Select the projects and click finish
All configuration data for your workspace is stored in .metadata. Try to recover the deleted folder then fix the workspace. Otherwise you will need to reconfigure everything.
You can salvage certain folders from .metadata to keep your preferences (e.g. key bindings) at least.
After importing your project, check your project properties, especially the entries in "Java Build Path". There you have to add the "src" directory as source folder. Maybe you also have to adjust the output folder and libraries you are using in your project.
create a new project.
copy your pages ,library files,etc.
set build paths.
compile it. then others will be automatically created
copy project to another (right click -> copy in eclipse)
new project created was correct for me in same situation and .class files repair .
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.