How to tell Netbeans IDE not to open previously opened projects on startup - netbeans

My netbeans seems to freeze every time I try to open it. It says waiting projects opened. I want to somehow clear the list of 'open projects' so that netbeans doesn't try and open them automatically on startup.
Maybe clearing the cache or something?
I'm running Netbeans 7.3 on Mac OS: X Mountain Lion

A little late, but I think
config/Preferences/org/netbeans/modules/projectui.properties is the file you are (were?) looking for.
Mine (Netbeans 8.1 on a GNU/Linux box) is located under %my_home_dir%/.netbeans/8.1/, like:
/home/scherrer/.netbeans/8.1/config/Preferences/org/netbeans/modules/projectui.properties
I've made a test renaming this file and when I opened the IDE no project was opened.

Clear netbeans cache:
Clearing the cache in Netbeans will probably cause it not to load previously opened projects: Clearing Cache in NetBeans

Clearing cache in Netbeans is not enough to avoid the load of the projects, instead you can close temporaly the projects.
With shift+Click you can select several projects to be closed:

I have the same problem and i solved it this way
Kill netbeans
Change the name of the folder where you have your projects
Open netbeans
re rename the folder to the original name
Open your projects one by one

Related

NetBeans background scanning projects takes too long

NetBeans background scanning projects takes too long. Every time when I open netbeans it scanning for ages. I used NetBeans 7.2 and it works perfecly. Now I formatted pc and reinstalled windows, install the same version of NetBeans 7.2, and it works to slow.
Having the same issue with 8.0.2 when a project has JS resources I tracked it down in my case to a problem with the javascript2 editor module which has been updated over the original version shipping with netbeans 8.0.2.
I simply solved it by removing the updated module.
On Linux:
rm ~/.netbeans/8.0.2/modules/org-netbeans-modules-javascript2-editor.jar
However, after letting the netbeans updater download the module a second time, the problem didn't appear again.
In Netbeans 8.1, the location of this file is at:
ide/modules/org-netbeans-modules-javascript2-editor.jar.
I have the same problem in netbeans but i found solution by unselect
the check from auto scan background
in your netbeans IDE go to tools and then Option and select then to miscellaneous and select file tab inside miscellaneous and
you will find check as "enable of auto-scanning of the source
unselect that one and netbeans will be fast then i hope it will help you
in fasting your IDE too
After latest update of Netbean 8.0.2 I have the same problem that scaning process did not stop and go forever with CPU usage on 25%.
When I replace javascrip editor files in C:\Program Files\NetBeans 8.0.2\ide\modules on Windows 7 with old one then scaning project process start work again. You can take those file from this repo.
i'm facing the same issue, but it works fine after increase the heap size by adding -J-Xmx2048m in <NETBEANS_DIR>\etc\netbeans.conf
mine looks like this:
netbeans_default_options="-J-client -J-Xss2m -J-Xms2048m -J-Xmx2048m -J-XX:PermSize=32m ......
Try the following :
1) Go to Window-->Files. This opens the Files Tab.
2) In the Files Tab for each opened project open the nbproject folder and inside it open the project.properties file.
3) Now in this file below the property "excludes" there are file references listed for all your referred Libraries (JARs)
4) There might be some repeated file references with paths that may be old or on someone else's machine(if you are working in a group and transferred projects from someone's machine)
5) Delete those old path references.
Example -
excludes=
file.reference.xyz.jar=../not/correct/path.jar //delete this line
file.reference.xyz.jar-1=../correct/path.jar //remove -1
....
includes=**
6)Also locate the property "javac.classpath" and delete the unnecessary classpath entries corresponding to the deleted references as described above.
Example -
javac.classpath=\
${file.reference.xyz.jar}:\ //keep this line
${file.reference.xyz.jar-1}:\ //delete this line
....
javac.compilerargs=
7) So now the file reference mentioned in the file reference section and the javac.classpath property is same and points to a valid Library (JAR) address on your machine or network.
Example -
excludes=
file.reference.xyz.jar=../correct/path.jar //the correct reference & path
....
includes=**
....
javac.classpath=\
${file.reference.xyz.jar}:\ //the correct classpath entry for reference
....
javac.compilerargs=
....
The reason the above procedure worked (in my case) is because it prevents Netbeans from scanning unnecessary Library paths that may not be present on your machine/network.
On Windows 10 64bit I had the same problem with Netbeans IDE 8.1
I restarted Netbeans as administrator and the problem was solved. Then I closed Netbeans and started normally and the problem was still gone.
Product Version: NetBeans IDE 8.1 (Build 201510222201)
Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Windows 10 version 10.0 running on amd64; Cp1252; nl_NL (nb)
OS: Windows 7 x64.
The following worked for me:
I fully uninstalled Netbeans (ticked all boxes in uninstaller). For those who couldn't you'll need to go to C:\Users\%username%\AppData\Roaming\NetBeans\8.0.2 and delete a file called 'lock'. This is normally removed when the program exits but if you need to force terminate it'll remain there.
After that I uninstalled JDK and JRE then downloaded Java Platform (JDK) 8u40:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
And Netbeans 8.0.2:
https://netbeans.org/downloads/
Installed JDK (which installs JRE too), after that Netbeans. Once complete I loaded up projects where background scanning got stuck and it seems to have fixed it. Will post updates if it starts happening again.
I actually made a bug report for this issue. It was fixed and pushed to the update channels yesterday. So for anyone still having this specific bug, let Netbeans check for updates. :)
Bugfix: https://netbeans.org/bugzilla/show_bug.cgi?id=250985
On Ubuntu 18.04 / Netbeans 10.0, I had the same problem.
[FAIL] Deleted cache
[FAIL] Deleted project-specific "nbproject" dir
[FAIL] Closed the offending project (mouseover the progress bar to identify which one) --> restart NB --> create new project
[SUCCESS] Nuked the project from the F/S --> re-cloned --> restarted NB. I also renamed the directory itself, in case there was some other cache that pointed to the old dirname.
Please try NetBeans 8.0.2 from https://netbeans.org/downloads/
NetBeans 7.2 is too old and you will not get any support anymore.
I was having the same problem with Netbeans 8.1, Windows 10. It was also hanging when I tried to compile and refactor. It would sometimes say 100% done yet continue background scanning for hours. I closed the project in which this was happening, and switched to a simple project and the problem went away. So I examined my code. I had class A extending class B, then class B importing class A. When I changed this, the endless looping in Ant stopped.
Always I fix such Netbeans related problems by deleting cache directory.
Directory location can be seen on About dialog window.
For me, the path is
C:\Users\USER\AppData\Local\NetBeans\Cache\YOUR_VERSION
This problem is related to one of the project opened in your IDE. As I had been facing the same issue but, after spending two hours on that issue I finally fixed that. Close project one by one or check and close the project where background processing is taking time. After closing the project delete the .nbproject folder and re-import the same project into your IDE.
It should be called foreground scanning of projects. Closing the program and restarting solves it for me sometimes.
I had the same problem but in my case I was on Windows 10 and running NetBeans 8.1.
Before I formatted my laptop I copied and backed up C:\Users\user_name\AppData\Roaming\NetBeans\8.1 and C:\Users\user_name\AppData\Local\NetBeans\Cache folders
Then i followed the below steps:
Install NetBeans and run it.
Closed NetBeans
Go to C:\Users\user_name\AppData\Roaming\NetBeans\8.1 and C:\Users\user_name\AppData\Local\NetBeans\Cache folders and replace them with the backed up folders.
Run NetBeans again
I hope this solves your problem!!
In my Laravel case ,got this "forever scanning" because the project was created in another IDE. I put the old IDE related folders .idea , vendor , node_modules into myproject->Properties->Ignored folders . Relaunched NetBeans as admin. It will scan a little bit but next time wont stick on that.

Eclipse Error: Cannot determine URI for /project-path/

I'm running Eclipse Luna on Ubuntu 12.0.4 in VirtualBox with a Windows 8 host and every once in a while, I will boot up Ubuntu and open up Eclipse to find this:
My projects should be listed in the package explorer but it's all empty and whenever I try to import the project again, it says no projects are found.
At this point, I usually go to my workspace folder and delete the .lock file and rebuild the workspace but is there an alternative to this? This error happens every ~5 times I reopen Eclipse and it has become very annoying. Any help will be appreciated!
EDIT: Okay I just tried deleting the .lock file in the .metadata folder in my workspace and I'm still getting the same error. Any suggestions?
EDIT 2: While closing my currently open tabs, I got this error. The projects that were open were Maven projects if that makes a difference.
so I am a little late for the party, but I fixed that on reimporting my projects.
Under File->Import.. you choose General->Import existing Projects into workspace. On the next page you set your workspace directory as the root directory for importing, which will give you a warning like "Some projects already exist in workspace". Ignore this and click finish.
After that all my projects where back in my workspace.
Good luck
To solve this problem, I re-created my workspace and imported my projects again.
Creating a new workspace is done via:
File > Switch Workspace
This is not an optimal solution, but until Eclipse fixes these bugs, this can save you some time trying to debug your current workspace.
I previously had a very small number of Eclipse plugins installed. So, I quickly headed to the Marketplace and installed my plugins.
And yes, Eclipse's downfall is expected. I personally find IntelliJ IDEs much better.

eclipse: cannot load workspace

I try to give you a summary of what happened. [...] means that passed some time.
OS is Linux
all was working fine
[...]
every time I started eclipse I needed to switch workspace even if there was only default workspace in the list of workspaces
[...]
I added build.xml following an Ant tutorial to one of my projects
When I ran it using Ant, it ran out of memory. I turned off eclipse.
When I restarted eclipse, once switched to correct workspace each of my open files reported:
Plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.
package explorer says: Plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.
What's happened? How can I restore it?
I resolved the problem by manually removing build.xml from project folder and restarting eclipse. Hope this helps.
EDIT: after restarting Linux the problem reappeared.
WORKAROUND: The problem seems to happen after an incorrect shutdown. I found this workaround:
close eclipse
restart OS (not sure if is needed)
manually cut the folder of the project opened in eclipse when incorrect shutdown happened and temporary past it outside workspace (i.e. on desktop)
restart eclipse
close eclipse
restore the project folder into workspace
restart eclipse
I answered a similar problem but in Windows in this Question: "Plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart." issue in adt ( v22.6.2)
Maybe this will help others.

How to clear the cache in NetBeans

This question's answers are a community effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions.
I created a project in NetBeans, and I would like to clear the NetBeans cache.
I'm running NetBeans 7.0.1 on a Windows 7 machine.
How do I do this?
Close NetBeans before deleting the cache.
NetBeans 7.2+, Windows 7
Cache is located in C:\Users\<username>\AppData\Local\NetBeans\Cache\.
Clear the cache using the %USERPROFILE% Windows variable:
del /s /q %USERPROFILE%\AppData\Local\NetBeans\Cache\
If it is set, you can also use the environment variable %LOCALAPPDATA%:
del /s /q %LOCALAPPDATA%\NetBeans\Cache\
NetBeans 7.2+, Linux
Cache is at: ~/.cache/netbeans/${netbeans_version}/index/
Mac OS X
Cache is at: ~/Library/Caches/NetBeans/${netbeans_version}/
See also http://wiki.netbeans.org/FaqWhatIsUserdir.
Help Menu
On Windows, selecting the Help » About menu will display a dialog that contains the following text:
Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Java: 1.7.0_80; Java HotSpot(TM) 64-Bit Server VM 24.80-b11
Runtime: Java(TM) SE Runtime Environment 1.7.0_80-b15
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Username\AppData\Roaming\NetBeans\8.0.2
Cache directory: C:\Users\Username\AppData\Local\NetBeans\Cache\8.0.2
Regardless of operating system, the About dialog will contain the correct path to the cache directory.
The path of the cache directory is listed in the About window (menu Help/About). Close NetBeans, then delete (or rename) the directory. NetBeans will rebuild its cache when it starts up.
Before 7.2, the cache is at C:\Users\username\.netbeans\7.0\var\cache. Deleting this directory should clear the cache for you.
On a Mac with NetBeans 8.1,
NetBeans → About
Find User Directory path in the About screen
rm -fr 8.1 In your case the version could be different; remove the right version folder.
Reopen NetBeans
I'll just add that I have tried to resolve reference problems caused by a missing library in the cache, and deleting the cache was not enough to solve the problem.
I closed NetBeans (7.2.1), deleted the cache, then reopened NetBeans, and it regenerated the cache, but the library was still missing (checked by looking in .../Cache/7.2.1/index/archives.properties).
To resolve the problem I had to close my open projects before closing NetBeans and deleting the cache.
For Netbeans 7.4 and above in Linux, the cache is $HOME/.cache/netbeans/7.4.
In Window 7 the cache is located at C:/Users/USERNAME/AppData/Local/NetBeans/Cache
The NetBeans cachedir is a directory consisting of files that may become large, may change frequently, and can be deleted and recreated at any time. For example, the results of the Java classpath scan reside in the cachedir.
NetBeans 7.1 and older
By default the userdir is inside a (hidden) directory called .netbeans stored in the user's home directory. The home directory is ${HOME} on Unix-like systems, and %USERPROFILE% (usually set to C:\Documents and Settings\) on Windows. The cachedir can be found in var/cache subfolder of the userdir.
As the name suggests, the userdir is unique per user. For each version of NetBeans installed, the userdir will be a unique subdirectory such as .netbeans/.
To find out your exact userdir location, go to the IDE's main menu, and choose Help > About. (Mac: NetBeans > About NetBeans).
NetBeans 7.1 allows to separate the cache directory using a switch --cachedir to a desired location.
Examples
A Windows user jdoe running NetBeans 5.0 is likely to find his userdir under
C:\Documents and Settings\jdoe.netbeans\5.0\
A Windows Vista user jdoe running NetBeans 5.0 is likely to find his userdir under
C:\Users\jdoe.netbeans\5.0\
A Mac OS X user jdoe running NetBeans 5.0 is likely to find his userdir under
/Users/jdoe/.netbeans/5.0/ (To open this folder in the Finder, choose Go > Go to Folder from the Finder menu, type /Users/jdoe/.netbeans/5.0/ into the box, and click Go.)
A Linux user jdoe running NetBeans 5.0 is likely to find his userdir under
/home/jdoe/.netbeans/5.0/
For More Info
See this documentation at the NetBeans site: NetBeans 7.2 and newer
For NetBeans 8+ on Windows 10 there's a definitive bug with duplicate classes error which is being solved by cleaning the cache at
C:\Users\<user>\AppData\Local\NetBeans\Cache.
Just install cache eraser plugin, it is compatible with nb6.9, 7.0,7.1,7.2 and 7.3:
To configure the plugin you have to provide the cache dir which is in netbean's about screen.
Then with Tools->erase cache, you clear the netbeans cache.
That is all, good luck.
http://plugins.netbeans.org/plugin/40014/cache-eraser
The cache is C:\Users\userName\AppData\Local\NetBeans\Cache\, and then the version name of the folder will specify the correct cache.
You can also do this: Close the IDE. Instead, of deleting files and risking everything, rename this cache folder. Now start the IDE. Once it starts, a new cache folder will be created since the folder is not found. Now you can delete the renamed folder safely.
tl;dr
You might not need to whack your entire NetBeans cache.
My problem manifested as running a clean build didn't delete the previous build folder or testuserdir folder, while I was using NetBeans 8.0.2.
The first time I had this problem, Ray Slater's answer above helped me immensely. I had two Project Groups, and had to close each project in both groups, close NetBeans, clear the cache, then add my projects back to my groups before it would work again.
Later, this problem cropped up again with NetBeans 8.1. I closed NetBeans, and ran ant build clean at the command line, and it worked. When I reopened NetBeans, the problem was resolved. It occurs to me that NetBeans was keeping something open and just needed to be closed in order to delete the folders.
Update
I finally figured out what was going on. Somehow, my NetBeans "Module Suite Project" (yellow/orange puzzle pieces icon) had been closed and the "Module Project" (purple puzzle piece icon) having the same exact name as the "Module Suite Project" was open. Building clean cleaned that particular Project correctly, but did not clean the entire Suite.
Now that I have the "Module Suite Project" opened correctly again, things work as expected. This explains why ant build clean worked, since it was done on the command line at the right level to clean the whole Suite.
I suspect I didn't strictly need to clean out my NetBeans cache at all though perhaps doing so actually fixed the issue of why it was only showing the "Module Project" instead of the "Module Suite Project", thereby doing the right thing when I clicked build clean... If I had simply realized that the Suite was no longer open and only the Project was, I could have fixed it in three seconds.
I have tried this
UserName=radhason
C:\Users\radhason\AppData\Local\NetBeans\Cache
Press Ok button , then cache folder will be shown and delete this cache folder of netbeans.

Eclipse hangs while opening workspace after upgrading to GWT 2.0/Google app engine 1.2.8

After upgrading to the newest GWT/Google app engine I have problems opening my workspace in Eclipse. On startup, Eclipse hangs almost immediately and needs to be closed. This happens only in the workspace where I use GWT with app engine, and I weren't able to consistently reproduce it - sometimes it starts normally, and sometimes I need to kill the proces and restart it. There is nothing in Eclipse error log. Eclipse version is Galileo, running on Windows 7 RC.
Anyone else had similar problems? I googled but Google is not my friend today.
EDIT: Still happens after upgrading to GWT 2.0.1.
I got frustrated with not being able to open my workspace today, and finally solved this by importing projects into a new clean workspace.
Create new workspace and open it in Eclipse (to create .metadata folder).
Close Eclipse.
Manually copy all settings from old workspace (the most important settings are stored in the .metadata/.plugins/org.eclipse.core.runtime/.settings directory). Alternatively, you could use File / Export / General / Preferences in Eclipse, and then File / Import them, but I wasn't able to open workspace to do that.
Open the new workspace.
File / Import / General / Existing projects into workspace. Select root folder of your old workspace, and take care to check "Copy project into workspace".
Restart Eclipse and check that everything in the new workspace is working as it should.
Delete your old workspace.
EDIT: Another, and a bit better workaround which apparently works:
Close Eclipse.
Temporary move offending project somewhere out of the workspace.
Start Eclipse, wait for workspace to load (it should).
Close Eclipse again.
Move the project back to workspace.
I used "eclipse -refresh". Apparently it hangs on refresh something, the lower right corner tells you, what it's doing. For me it was refreshing the gwt runtime in a specific project, maybe trying to find an update or something. If you don't want to reimport your whole workspace, try -refresh or move this project temporarily out of the way.
I just deleted the state.dat file in the GWT project metadata, which seemed to remove the blocking and then triggered a recompilation.
<workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects/<GWT project>/org.eclipse.jdt.core/state.dat
This probably won't serve as a general solution, but it worked for me and it's a lot quicker than having to copy whole projects. Maybe another file will have the same effect. I think the trick is just to "damage" the GWT project metadata enough to have it rebuilt.