Is it possible to restore current project functionality in NetBeans? - netbeans

Older versions of netbeans had the right click option to select the current project as the one to which the run/debug etc. functionality is mapped. Since I work in libraries and dependent projects 99% of the time this was really useful when compared to the current approach of running the project of the current file.
I know I can right click to debug/run or select the project from the project explorer but I'd love to have the old option to work with the current project. Can this be restored via a preference in NetBeans 8+?

You are searching "Run / Set Main Project". After you selected a main project (via the run-menu) you can also switch main projects right-clicking on a project in the projects view. Why they are not showing this menu in the contextmenu when no main project is selected, is a mystery to me.

Related

eclipse: Managing projects

I have tried to find these out, but could not.
Can eclipse open all dependent projects? I have a maven project with dependencies. Can eclipse open dependent projects also? (or at least try to, as some of the dependencies are external and would have no sources/project)
As a workaround to the above possible limitation in eclipse, i have created working sets and added projects to them. But could not see an option to open all projects in a working set one one shot. Is there such an option?
(Using eclipse Kepler)
Selecting this option should do it for you.
mark all project, right click and select open project

Eclipse opens old versions of my project

When opening Eclipse the project version is not the current one(it automatically opens the very beginning version of the project, not the current files on my drive).
I tried modifying the refresh settings in Preferences->Workspace, no luck. Also, when I right click->Refresh the project nothing happens.
I am using the last version of Eclipse Luna and the PyDev perspective.
have you tried go File then Switch Workspace e selected the right one? (even if ther is only one)
Some time it happend to me, maybe when i have eclipse opened and i click again on the eclipse startup app it ask me "load new workspace..." and it messup all
Try to look that its clearly the Workspace you would to use.
Do you have different Workspaces?
Try to check the location of the project.
Right-click on the project in Package Explorer and select "Properties"
Select "Resources" on right side and check the location.
If the location is wrong, try to import the right one using method as follows:
Right-click in Package Explorer and select "Import"
Select General->Existing Projects into Workspace and import the project.

have IntelliJ IDEA refresh the project and detect changed files

I'm using Eclipse for development because of all the things IntelliJ can't do (e.g. highlight all instances of a variable) and because IntelliJ is dog slow over a remote connection. But because I still don't have Maven integrated completely into Eclipse, I have to switch back to IntelliJ to compile and run my project using Tomcat.
How can I tell IntelliJ to detect all files that have changed on the file system and recompile them? (I don't want to manually open each changed file to get IntelliJ to detect the change.) In Eclipse I would just Refresh the project tree [1]...
Footnotes:
Eclipse has a feature (named "Refresh Using native hooks or polling") which you can enable to automatically detect changes and synchronise the perspective when any underlying changes are detected in the filesystem (see images below). This is quite handy and eliminates the need to manually refresh the project when using build tools - where files/directories get created in the project directory structure.
Is there anything similar for Intellij (explicit setting or otherwise) that eliminates having to click a button to synchronize the view with filesystem changes?
You can use the "synchronize" button (two yellow arrows) or in short Ctrl+Alt+Y
Intellij can highlight variable instances, you just need to enable it .
Further, if you invoke compile project, Intellij will just compile changed files (and hotswap when possible, if you are in debug mode & deploying to e.g. tomcat)
Right click on your Project in the left pane and click on "Synchronize"
You can see the status in the round circling icon at the bottom left of the IDE
I know this question was posted a few years ago, but maybe this info will help someone in the future. I was actually looking into a similar issue, and doing the following worked for me:
Go to Settings > Build, Execution, Deployment > Compiler and make sure "Make project automatically" is checked.
Click File>Synchronize (or) shortcut ctrl+Alt+Y
There is a synchronise button in the tool bar. Click it and it will refresh the project explorer

Moving project to another folder in Eclipse

I generally have my working projects sitting on folders on my Desktop. When they are completed I just move them to a c:\dev\. The thing is I'm doing it in a rather archaic way.
1. move project files
2. delete project on Eclipse
3. create new project on Eclipse on the new location
How to you guys move projects around?
If I could alter the: File -> Properties -> Resource -> Location path it would be dead simple!
Example move:
c:\user\desktop\project_123
c:\dev\project_123
Right click on the Eclipse project in the Package Explorer, select Refactor, then select Move... In the dialog that comes up, enter or navigate to the new location and click OK. This will also preserve your CVS or other SCM metadata, but will also bring all your modifications as well, and you won't lose any memberships in Working Sets, launch configurations, or other things that Eclipse associates with your project.
Use Eclipse's Move menu item
Open Navigator view, right click on your project and click Move. Then select the destination directory.
Navigator View > Right Click > Move
Note it doesn't seem to work in Package Explorer (at least not in Neon). The move dialog from Package Explorer is different, so use the Navigator window.
I don't know whether eclipse has made modifs since the date of this post...
In my case I had moved a project folder manually and I wanted Eclipse to open the project on this new location. This is what I did (and it seems to work).
(I'm using eclipse "helios" v 3.6.2)
File menu | Import ...
General | Existing projects into Workspace
Select root directory = top directory of your project on the new location
Finish
I rarely have any projects in Eclipse that aren't under source control, so all I would need to do is check the project out in the new location.
If you don't have source control, Eclipse works with CVS rather well out of the box, and it's pretty simple to setup CVS to run locally without a server: http://www.tortoisecvs.org/faq.html#cvsinit
WHEN EVERYTHING ELSE FAILS:
Copying an Eclipse project from one directory (let's call it old_dir) to another directory (let's call it new_dir):
Open Eclipse and specify the copied working directory in your new_dir.
Once it opens the project in the this new_dir, the projects listed under Project Explorer Tab might still be the ones contained in the old_dir (you can check it by right clicking each and following through: "Resource -> Linked Resource" to see the Path Variables values). Thus, they have to be removed from this work space. Delete the Nios 2 Application Project and the BSP Project from the Project Explorer Tab by right clicking on it and selecting Delete option which will pop a new window. In the pop-up window, make sure that the Delete project contents on disk check box is UNCHECKED before clicking OK to delete the Projects. Otherwise, it will delete it from the old_dir where you copied the project from.
Right click in the Project Explorer Tab Area → Import → General → Existing Projects into Workspace and add the copied Nios2 Application Project and the BSP Project from the new_dir.
Right click in the Project Explorer Tab Area → Index → Rebuild, otherwise the Nios2 Application Project will not be able to use the includes provided by the BSP Project.
Click on Project → Clean → OK to clean and rebuild the whole project.
When using console to talk to the NIOS, make sure elf's path is updated to the new project directory as well!
Right click on your project->copy.
right click in project explorer free space and right click->pase.
chose new folder and project name.
I copied the whole project to a new directory. After setting Eclipse to the new workspace it recognises the project instantly. Thus it was nothing further to do. I use Eclipse IDE for C/C++ Developers, Version Luna Service Release 2 (4.4.2).
For Eclipse Oxygen, to move a Java project, djb's accepted answer works well (in my experience just now), except having read comment by Basic May 14 '12 at 9:27, I tried to add my project XMLDiff to C:...\SVN\trunk\Internal Projects, and I got a failure with the rather cryptic message:
Problems encountered while moving resources.
Resource already exists on disk.
I had to move the project to C:...\SVN\trunk\Internal Projects\XMLDiff by creating a new folder, XMLDiff, in the browse dialog, and the result was C:...\SVN\trunk\Internal Projects\XMLDiff, not C:...\SVN\trunk\Internal Projects\XMLDiff\XMLDiff.
So this must have changed between Basic's experience in 2012 and Eclipse.3.
For Eclipse Oxygen
Project Properties -> Resource -> Linked Resources -> Linked Resources (Tab)

Build file and Ant Targets from Project Menu in Netbeans (6.7)

I've recently started using netbeans for a few hobby projects. I've come from a JDeveloper background and I'm used to been able to see my ant build file from the project explorer window.
In JDeveloper this has the advantage of allowing you to right click on it, allow easy edits, or run a required target when you want to.
The only way I can seem to do this in netbeans is to open up the build.xml file, right click and select my target and run it.
Hope everyone is still with me.
I guess the build, compile, test, clean options you get in the project menu when you right click on a project are wired automagically to the ant targets. But I tried to create a new target and see if it was displayed in the normal project menu, and its not.
Does anyone know why Netbeans doesn't include the build.xml file in the project structure or whether it can be included in the project explorer display easily.
Kris
It sounds like you want to switch to the Files view. You can find the build.xml file in that view easily. If you right click on the file, you get a menu that includes items like 'Run Target' and 'Debug Target'.
If you want to have even more control over the mapping between menu items and ant targets, you should explore the Java Free-Form Project type.
Go to Files tab, find your build.xml, expand all targets, right click on the target you want to add and choose between the options provided.