Netbeans sometimes displays error badges in situations where no actual error occours. (Often on folders, too)
Although Google finds many pages reporting this issue for various Netbeans versions, I could not found a solution to reset the error badges without deleting and re-creating the project with a different name (!).
How can I remove the badges besides recreating the project?
Somewhere Netbeans has to store the information which folder has an error badge. Perhaps it is possible to delete some kind of cache and be done with it.
I discovered it myself: The Netbeans errors are cached in the index sub-directory of the Netbeans user directory. Here are the some .err and .warn files, which contain the error and the warning messages.
That's also the reason why recreating a project with the same name doesn't get rid of the badges: The data is stored outside of the project.
Deleting all *.err and *.warn files in that directory and all sub directories makes Netbeans forget the error badges until they are recreated because of a real compile error.
PS: Be prepared for a rescan of your projects after deleting files from the cache, but it should be quick if no other files have been deleted.
NetBeans has moved the userdir directory
See here for your specific OS: http://wiki.netbeans.org/FaqWhatIsUserdir
Unix-Like Systems (and Mac OS for NB 7.1 and earlier) script:
find ~/.netbeans/7.1/var/cache/index/ -name "*.err" -exec rm {} \;
find ~/.netbeans/7.1/var/cache/index/ -name "*.warn" -exec rm {} \;
Mac OS Systems NB 7.2 and later script:
find ~/Library/Caches/NetBeans/7.2rc1/index/ -name "*.err" -exec rm {} \;
find ~/Library/Caches/NetBeans/7.2rc1/index/ -name "*.warn" -exec rm {} \;
You can download the netbeans's cache eraser plugin:
http://plugins.netbeans.org/plugin/40014/cache-eraser
You have to configure the cache dir path, it appears in netbeans about screen.
Erase the cache with the plugin and the errors disappear.
After 4 years with this annoying red errors badges, i decided to make something on my own as windows user (you can do something alike for others OS) to get rid of this.
You have to create a batch script as follow :
:: DEFINE YOUR NETBEANS APP PATH HERE
set cache_path=C:\Users\YOUR_USER_NAME\AppData\Local\NetBeans\Cache\8.2\
set exe_path=C:\Program Files\NetBeans 8.2\bin\netbeans64.exe
:: SEARCH FOR .ERR FILES WITHIN CACHE PATH AND DELETE THEM
del /s /q /f %cache_path%*.err
:: OPEN NETBEANS APP AFTER .ERR CLEANING IS DONE
start "" "%exe_path%"
:: CLOSE CONSOLE
exit 0
You have to modify the two first var line to change for you own Netbeans paths.
Save this code in a bat file ("run_clean_netbeans.bat" for exemple) and run it.
The script will look for all .err files in the cache directory of netbeans, delete them, and run the Netbeans app just after.
Error badges won't show up anymore (clean .err files on each restart of Netbeans).
I even did a shortcut of this bat file with the Netbeans icon to have something like the original exe (you can put it in your task-bar for exemple).
Capture of the bat file + shortcut to it
You can find a zip containing my bat and my shortcut in the link bellow, just modify it to your liking.
https://www.mediafire.com/?svnl89vybdhczld
Enjoy :)
On Linux, clear the userdir(.netbeans/8.0.2) and the cache(.cache/netbeans/8.0.2) directories completely and launch Netbeans again. This will remove the incorrect error badges.
In my case, it was not userdir that makes the error, it was cachedir.
The cachedir is separate from userdir and its default path is also system specific:
C:\Users\\AppData\Local\NetBeans\Cache\8.2\ on Windows
/Users//Library/Caches/NetBeans/8.2/ on Mac OS X
/home//.cache/netbeans/8.2 on Unix-like systems
I try to find the root cause by finding .err and .warn using find command.
find . -name *.err -type f
find . -name *.warn -type f
I find 0 warn file and 4 error files. However, the error files is not related to my project.
I ended up deleting (or rename to .old) Caches/NetBeans/8.2/, I open up NetBeans and the error icon is gone. Beware that using this approach NetBeans will take a longer time to launch.
On netbeans 11 it was not enough to just remove the .err and .warn files. I had to remove the index directory which was in ~/.cache/netbeans/11.0
Related
Have a perplexing bug when I try to reconcile work through the CLI for perforce in that I get a large amount of files detected and added to the changelist whenever I run the command.
This happens regardless of where my current working directory is but the files always come from there, if my working directory is outside the project's root I get a 'Path {path} is not under client's root' error and they are not added, however if my working directory is under the project root they are detected and added as missing files.
I've tried numerous different combinations of the reconcile command, explicitly stating the port, user, client etc., setting up P4Config, using relative and absolute paths, changing the working directory - but I always get these ghost files.
Has anyone come across this before? Could this be a bug with P4 itself?
Edit: I finally fixed this by reinstalling P4V so I'm assuming this was some bug either my install of perforce or any local config files that would have been reset upon reinstall. For reference this is the page that finally fixed it https://community.perforce.com/s/article/15324
This is the result of the following bug:
https://www.perforce.com/perforce/doc.current/user/relnotes.txt
Bugs fixed in 2020.1 Patch 1 (2020.1/1991450)
...
#1964794 (Job #102470) *
'p4 reconcile'/'p4 status' might report about invalid filenames
of the form '//depot/0' or '//depot/100', etc. This is fixed.
Since this was fixed in a 2020.1 patch, it can be inferred that it only affects specific 2020.1 builds (i.e. those before the patch).
To fix it, make sure you're on a client version (p4 or P4V; this is not a server-side bug) whose changelist number is higher than 1964794. No special reinstallation procedure is needed; just download the latest binary/installer from Perforce's website.
Force a reinstall of P4V to fix this, details can be found here:
https://community.perforce.com/s/article/15324
Or if that page is taken down for any reason:
SOLUTION
Forcing a reinstall using the Windows msiexec installer utility with Windows msi installer file extracted from the p4vinst64.exe file can often successfully complete a full reinstall where running the P4V exe installer such as "p4vinst64.exe" fails
If not already downloaded, obtain the appropiate Windows installer for P4V (for example "p4vinst64.exe" for 64 bit Windows platforms). Currently these can be downloaded from https://www.perforce.com/downloads/helix-visual-client-p4v
Extract the msi from p4vinst64.exe; for example to extract it to "c:\p4v", open a Windows a cmd prompt and change directory to the location where p4vinst64.exe .is located and run the following command:
p4vinst64.exe /s /b"c:\p4v" /v"/qn"
Now from c:\p4v, run the following command to force a full reinstall:
msiexec /i "p4vinst64.msi" /qn REINSTALL=ALL REINSTALLMODE=vamus /L*v log.txt
I just started using VSCode version 1.24.1.
After loading a folder, it shows warning
Visual Studio Code is unable to watch for file changes in this large workspace
After i check the limit as suggested on their guide, using
cat /proc/sys/fs/inotify/max_user_watches
I get 8192, while my project has only 650 files (of which 400 are inside .git)
Why does this happen? Is this a bug or am I missing something?
(Increasing the limit is clearly not the right solution.)
what linux ppl dont know, there are ppl new to linux like me. So if you're a noob, this is for you.
Open a new terminal.
cat /proc/sys/fs/inotify/max_user_watches (might be a number 8k+)
now (a) for vim-Editor
(a) sudo vim /etc/sysctl.conf
(a) go all the way down and add a new line with: fs.inotify.max_user_watches=524288 (make sure you DONT have a # in front of the command)
(a) type :wq! and press enter
or (b) for nano-Editor (thanks to #bradrar)
(b) sudo nano /etc/sysctl.conf
(b) go all the way down and add a new line with: fs.inotify.max_user_watches=524288 (make sure you DONT have a # in front of the command)
(b) type ctrl + x, type y and press enter
type sudo sysctl -p
type again: cat /proc/sys/fs/inotify/max_user_watches (should be 500k+ now)
(thank me later.)
The solution I found and it's work for me is
add this line fs.inotify.max_user_watches=524288 in to /etc/sysctl.conf
and then run the command sudo sysctl -p
and then go to your vscode settings find a file called settings.json
and this line to it
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true
}
you can also refer this link https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
The fact that you are out of watches does not mean that its VSCode's fault.
VSCode has for sure issues with excluding directories from watch (on linux) (update: most are recently resolved here, and here)
But since you have counted the files yourself, the error message in this case is probably misleading and some other application has already exhausted watches.
To trace the guilty app you can use this nice script
In my case I do not have enough privileges to change the sysctl.conf, so my solution for Ubuntu 18.04 LTS was:
sudo /bin/su -c "echo 'fs.inotify.max_user_watches=524288' >> /etc/sysctl.conf"
sudo sysctl -p
In my case (PHP using Composer), I had to exclude vendor path from watching
Depending on your case, you should exclude your dependencies folder.
Following settings worked for me (inside .vscode/settings.json, you can also put them at user level / system level settings in vscode instead of workspace level settings)
"files.watcherExclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/node_modules": true,
"**/some-soft-link-to-higher-level-directory-in-my-file-system" : true,
"**/.cache-loader" : true
}
.git, node_modules are perhaps excluded by default, but depending on your workspace, you may need to add others. As an example, I had a soft link to a higher level directory in my file-system (which recursively had 100s of thousands of files). Similarly, .cache-loader often has thousands of files.
Possibly useful note: it took me some time to realize that files.exclude and files.watcherExclude are two different settings.
Some theoretical opinion: Most answers here (and even in the official vscode documentation) suggest increasing the system watcher limits to a very large number. This works okay in most cases, however, it is like using a hammer in place of a screwdriver (is brute force, may not always work, and is not efficient). While the absolute system limit can (and perhaps should be) raised from the default limit, it is beneficial to optimize your workspace and avoid using unnecessary system resources.
Here is the solution : https://code.visualstudio.com/docs/setup/linux
The limit can be increased to its maximum by editing /etc/sysctl.conf and adding this line to the end of the file: fs.inotify.max_user_watches=524288
The new value can then be loaded in by running sudo sysctl -p
Oct. 2021: this is improved from VSCode 1.61 (Sept. 2021, see below)
VSCode 1.62 includes:
File watching changes
File watching in VS Code changes to a new library, thanks to the work of the Parcel team with their #parcel/watcher.
We will gradually roll out this change to all users in the upcoming weeks.
Linux users will be happy to learn that the files.watcherExclude now applies natively so that the number of file handles VS Code needs to open for file watching can be greatly reduced.
The existing files.legacyWatcher setting was changed to an enumeration with these values:
on - The new file watcher will never be used.
off - The new file watcher will always be used.
default - The new file watcher will only be used when you open multi-root workspaces (via .code-workspace file).
Feb. 2021: As noted in issue 40898, the issue persists for the multi-root workspace (see the last part, for VSCode 1.61 improvements)
Initial problem is that the npm install takes twice as long to install dependencies when VSCode is running.
I've figured out that this is because of file watching for the node_modules folder so I added it to files.watcherExclude.
I use the following combinations (but non of them seems to be working):
"files.watcherExclude": {
"**/node_modules": true,
"**/node_modules/**": true,
"**/node_modules/*/**": true
}
This comment points out a script from Dirk Feytons to see which inotify watches are actually being created to confirm whether my watcher excludes were being used or not.
/*
* If you want to see which inotify watches are being created by an application then you can
* use this simple piece of code, compile it to a shared library and LD_PRELOAD it when starting
* the application. Keep an eye on syslog to see the list of watches.
* **NOTE**: This only logs the watches, it won't actually create the watch and thus watching
* for changes WON'T actually WORK!
*
* More details (adjust as needed for your environment/distribution):
* - Save this file in e.g. $HOME/inotify.c
* - Compile: gcc -shared -o inotify.so inotify.c
* - Start monitoring syslog: tail -f -n 0 /var/log/syslog | tee $HOME/watches.log
* - Run your application with: LD_PRELOAD=$HOME/inotify.so <application>
*/
#include <sys/inotify.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
int inotify_add_watch(int fd, const char *pathname, uint32_t mask)
{
syslog(LOG_USER | LOG_ERR, "********** [%u] inotify_add_watch for %s", getpid(), pathname);
return 100000;
}
Update Sept. 2021, from Lionel Gatibelza:
I was able to fix the problem, I don't know the real cause and why Vscode performed this check for the error, but I did the known fix on the remote server and on my local machine:
Add this fs.inotify.max_user_watches=524288 to /etc/sysctl.conf
Reload the configuration: sudo sysctl -p
Close and reopen vscode
After that I didn't have the error again!
And from issue 132483 from Benjamin Pasero (software engineer at Microsoft in Zurich):
Just to clarify, nsfw is used on Windows as well in multi-root workspaces.
It was our original intent 5y ago to replace all other watching solutions with nsfw so we enabled it only for multi-root scenarios, which target a lower user base (maybe 200.000 users) to get some testing and feedback.
The next step in this journey is to enable it for all users and remove the others.
PS: the only platform where nsfw is currently not enabled by default (unless you are in a multi-root workspace) is Linux because unfortunately nsfw does not support ignore patterns (our files.watcherExclude setting) and each folder in a hierarchy is counted as an opened file handle against the limited set of file handles in the OS, forcing users to increase that limit.
The plan is to implement that support in October and then also get Linux on board.
Sept. 2021, VSCode 1.61:
File watching changes
The file watcher used to detect changes to files and folders on disk changed to a library that can handle all of our supported platforms (Windows, Linux, macOS) and reduces the overhead of maintaining different watchers for different platforms.
We plan to enable this library by default on all platforms. This iteration we enabled it on Windows and macOS, while Linux is planned shortly after.
The new watcher should be faster on startup, resulting in fewer CPU cycles spent on large folders.
One downside of using the library is that the file watcher no longer automatically detects folders in a workspace that are symbolic links on macOS.
If you have such a setup, you can use the new files.watcherInclude setting to add symbolic link paths to include for file watching explicitly.
On the upside, you can use this new setting on Windows to explicitly include symbolic link folders inside the workspace - something that was not possible before on Windows.
You should not notice any difference in your day to day work, but if file watching is broken for you, please report an issue.
There is a setting files.legacyWatcher to enable the old watcher in case of problems.
What helped me was creating a separate workspace for the project i was working on. So if i'm working on something in /htdocs/project/ then instead of just opening that folder i create it as a workspace.
TL; DR;
Seems like a bug.
-----
It seems the warning is gone now.
Unfortunately I cannot reproduce the bug right now, but here are some steps.
Installed Php Intellisense extension
From linux terminal did git init
Added folder into workspace
Did some work, added, saved, commit and push from command palette
closed VSC
Opened VSC -> warning was shown.
At this moment i saw in htop that there was a process /usr/share/code with long arguments which included something with TypeScript that was using 100% of 1 CPU and around 1G RAM. Then
closes VSC
killed process
opened VSC
Now the warning is not showing anymore, also CPU is being used normally.
I followed the recommendations from
https://stackoverflow.com/users/4270633/harsh-shah[harsh-shah][1]
Almost worked for me. I discovered I had resources in my project that were also being watched unnecessary.
VScode behavior seems to be watch everything, unless excluded.
If you find you have a couple hundred files in your project but have 32000 watchers - you may want to inventory what is in your project directory and exclude unnecessary directories.
For those using Pylance, setting "files.watcherExclude" may not suffice. The extension watches all paths reported by python sys.path.
source: https://github.com/microsoft/pylance-release/issues/2914#issuecomment-1154254992
Deactivating the extension is one, admittedly imperfect, solution if increasing max_user_watches is not an options.
If you are using for JavaScript development, there is a workaround:
Just disable this built-in extension: TypeScript and JavaScript Language Features
Raising the file limits of the system really only papers over the problem.
Are you really going to raise the watcher limit over the 100s of thousands that it already is at?
Instead, search in the repo for folders with a tone of files in them:
du --inodes -S | sort -rh | sed -n \
'1,50{/^.\{71\}/s/^\(.\{30\}\).*\(.\{37\}\)$/\1...\2/;p}'
vscode should already exclude node_modules and .git by default, so it is probably other folders that you have, likely auto-generated files from some app (a compilation or directory target, etc).
This one ignores .git and node_modules directories:
du --inodes -S | grep -v "node_modules" | grep -v ".git" | sort -rh | sed -n \
'1,50{/^.\{71\}/s/^\(.\{30\}\).*\(.\{37\}\)$/\1...\2/;p}'
You could also just remove recursively your node_modules if you are confident in running a fresh npm install. To remove:
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
If you are writing Javascript, then this is probably gonna work for this issue:
You have to access the side-bar extensions menu: Ctrl + Shift + X.
Then type: #builtin types and disable the extension: TypeScript and JavaScript language features.
When I start, Eclipse says "Workspace Cannot Be Locked"
"Could not launch the product because the associated workspace is currently in use by another Eclipse application." or “Workspace in use or cannot be created, chose a different one.”
But I know it isn't.
How do I "unlock" it?
Just delete the .lock file in the .metadata directory in your eclipse workspace directory.
Precaution - If you delete the .metadata folder all preference will be deleted.
I've seen 3 other fixes so far:
in .metadata/, rm .lock file
if #1 doesn't work, try killing the process javaw.exe etc. then rm .lock file
if #1 and #2 don't work, try rm .log file in .metadata/, and double check .plugin/.
This has always worked for me: relocate .metadata/, open and close eclipse, then overwrite .metadata back
The solution boils down to cleaning up the .metadata folder.
Go to TaskManager(Right Click in the Task Bar) and select Processess menu bar and select eclipse.exe and Click EndProcess
Another possible cause of the “Workspace in use or cannot be created, chose a different one” issue is that the real path to your workspace may have changed.
In my case, the real location of the workspace had changed, but I had used a symlink to make it look like it was in the same location. I saw errors in logs indicating that eclipse was looking at the previous "real" location, as opposed to following the symlink, and this was causing the errors.
In my case, I just moved the workspace back to its old location.
There is another case where the path to the workspace may not exist, e.g., if you have imported preferences from another workspace, then some imported workspace addresses may appear in your "open workspace" dialog; then if you didn't pay attention to those addresses, you would get the exact same error once you tried to open them.
Running eclipse in Administrator Mode fixed it for me. You can do this by [Right Click] -> Run as Administrator on the eclipse.exe from your install dir.
I was on a working environment with win7 machine having restrictive permission. I also did remove the .lock and .log files but that did not help. It can be a combination of all as well that made it work.
deleting logs and .lock didn't work but
-clean option fixed it for me.
At times, if you are on Windows, you may not see all the processes - or the culprit process in Task manager. I had to click 'Show process from all users' and there was this java.exe that I had to kill in order to get back my workspace.
Another possible case if none works is to see that there is a running Java application . may be your previous open and close has left unkilled java instances.
Do look for any java instance is running if there are two at least you need to kill one.But ,most of the time i kill any java running :) because that java is using the work space earlier and still will if don't kill it.
Change another work space in case if you want a multiple IDE to use and work on diffrent or same project , but you should import project form workspace after you open your IDE.
i was faced this issue when ever the eclipse is not closed (kill eclipse process the from task manager or computer power off), i was tried below steps, it worked for me.
1) Remove the file names start with ".fileTable" from this folder
C:\eclipse\configuration\org.eclipse.osgi.manager
2) Remove the log files like text files start with numeric names from this folder
C:\eclipse\configuration
3) Open Command prompt(cmd) navigate to this folder
C:\eclipse
type below command
eclipse clean start
For Mac Users:
It could be that another instance of eclipse is running in the background. If so, use either Force Quit eclipse or
ps -ef |grep eclipse
kill -9 pid
to all the eclipse instances, and start the new workspace
Start Eclipse with the option -Dosgi.locking=none.
I got the trick here and it works.
Don't do this unless you know nobody can work on the same file at the same time.
PLease try to end task Eclipse from taskbar. It works for me.
The answer #Boris gave is correct 99% of the time, however it can also happen if you open the workspace in an older version of Eclipse. A workspace imported into/created with Juno will throw this error when opened in Galileo.
Another all-too-common reason for this problem is if you attempt to load a directory on a drive that is no longer connected. For example, Say you program in C:\Code\Java, but occasionally work off of a flash drive, H:\Code\Java. If you do not have the drive connected it can be easy to believe you are trying to load a valid directory without noticing your typo.
Another problem is when eclipse doesn't have write access to your src folder. Change the security permission and make sure "Authenticated Users" are added with all permissions checked but Full Control & Special Permissions.
I had this error after I restarted the system (after a long time. Normally I just make it sleep).
Found out that once I mounted the drives (by clicking and opening it) where project folder is located, and relaunching eclipse, solved the issue for me.
PS: I'm an ubuntu user.
Here are a few steps to solve it the no. 4 step is works for me.
Delete .log files along .metadata folder.
Check the current user permission make sure to check the full control checkbox click apply then OK.
If you run system drive defragmentation or maintenance before you run eclipse editor sometimes original file path are not in their respective path to make sure run "previous version" time before your system maintenance of your drive where the eclipse workbench or something similar to this was saved.
This last option is works for me.
Check the drive letter of your current drive where the code editor was saved. If something unusual e.g before your maintenance your drive letter is K then after defragment or maintenance.
The drive letter is now L hence you should change the drive letter to its original one that is K.
to do this click the ff:
Open control panel
System & security
Administrative tools
Computer management
Disk management
in disk mngt choose the Drive example L
then right click > change drive letter & path > click remove > then ok, open it again then > click add and > choose your original drive letter for that drive then click ok. If you use your computer for a long period of time do restart first to refresh everything.
Choosing a "different one" is actually a pretty easy solution.
I had been running Eclipse as an administrator (sudo eclipse from the command line) because the "workspace" folder was throwing the Workspace in use or cannot be created… error (and running as administrator seemed to be the only solution that fixed it).
A coworker (working on this same issue with me) wanted to run Eclipse by clicking on an icon. So when he ran Eclipse, and the dialogue box came up with the choose your workspace, he just added a "2" to the end of "workspace".
This created a new folder: "workspace2". Eclipse ran fine with that; and I haven’t had any of the locking problems since.
It will occur when you not closed eclipse.exe correctly.
*Open Task manager->End task your eclipse->Now open eclipse.exe it will work.
Hope its help someone.
I have observed one case when eclipse when in forced quit, or Alt-f2 xkilled in linux, an attempt to immediately open eclipse shows that error. Even the metadat/.lock file is not present in that case.
However it starts working after a span of about two minutes
I don't know what's the wrong but I solved by creating a directory directly in c drive(c:\dev) instead of from my home folder (c:\users\me\dev). But I don't have to thinks about it. In my case, it is fresh eclipse unziped instance. I am not able to see .matadata folder in eclipse folder. By God grace, I solved.
The reason this was happening to me (with Photon) was easily fixed by changing an Eclipse general preference:
Window -> Preferences -> General: Uncheck: "Always run in background"
Once you make that change, whenever you shutdown Eclipse, it will no longer leave the javaw.exe process running in the background. I’m guessing this is a bug in Photon (or a bug with using the Amazon Corretto OpenJDK version of Java with Eclipse) that will one day be fixed.
I faced the same problem, but for some reasons the .lock file in workspace was not getting deleted. Even creating a new workspace was also getting locked.
So what I did was cleaning the windows temp folder, the %PREFETCH% folder and %TEMP% locations. Restart the system and then it allowed to delete the .lock file.
Maybe it will help someone.
It seems your workspace is used in Java TM, Open task manager and close eclipse.exe and java TM process.
What worked in my case was restarting the system. (ubuntu 20.04)
If anyone have come here with a STM32Cube related issue, which apparently is based on Eclipse and has the same problem, none of the above suggestions worked for me, and here is how I fixed it, for Linux, although I suppose you can find the corresponding paths in Windows as well.
In the $HOME directory, go to .eclipse/com.st.stm32cube.ide.../configuration/settings
The file org.eclipse.ui.ide.prefs contains few options including the recent workspace path, and whether it will prompt you to select a workspace at the startup. Either modify the path for RECENT_WORKSPACES, or enable SHOW_WORKSPACE_SELECTION_DIALOG.
In my case, there was a space right before the workspace's location C:\. I removed that space and it was enough :)
When i am trying to open eclipse exe file , window is not opened , why this is happened , previously it is working fine but today it is not opened any changes i need to do?it will help full if any one gave quick fix .
thanks
Ramana
(The OP ramana solved it by uninstalling and re-installing Java, but below is another potential cause)
Check if your PATH hasn't changed somehow: see Java Tips: “Adventure” in resolving the Java error “Error occurred during initialization of VM”
Running Java.exe produce error in other directories (since the SDK’s bin is added to path.)
However running in it’s bin directory, it runs fine.
In the case of the ips mentioned before, the issue was:
The good news is that it is nothing supernatural or magical image but the bad news is that the Windows directory is the “protagonist” image.
From file search, it can be concluded that somehow certain mischievous program is copying some crucial java files into Windows directory which are stored in path, and so unless the java’s bin is the foremost in the path, one will bound to get the error.
The error occurs because java.exe or other Java executable expect some support files and directories to be found but obviously could not find it in Windows directory.
Running the java.exe in its bin directory will not produce error because Windows will use the current directory to which the file is run first before searching for it in the path.
That might not be the case for you, but that could still be related to a PATH issue.
I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not found
Here are the Build Results:
CopyPNGFile /Users/me/path/build/Dist-iphoneos/MyApp.app/img_000.png images/img_000.png
cd /Users/me/
setenv COPY_COMMAND /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
"/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng" -compress "" /Users/path/images/img_000.png /Users/me/path/build/Dist-iphoneos/MyApp.app/img_000.png
sh: dirname: command not found
CopyPlistFile /Users/me/path/build/Dist-iphoneos/MyApp.app/Entitlements.plist Entitlements.plist
cd /Users/me/
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist --convert binary1 Entitlements.plist --outdir /Users/me/path/build/Dist-iphoneos/MyApp.app
sh: plutil: command not found
Your PATH variable is screwed up for some reason. You want to look into how exactly that happened. This is yours (colon-separated for emphasis):
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
:/Developer/usr/bin
:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
This is what a working PATH looks like:
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
:/Developer/usr/bin
:/usr/bin
:/bin
:/usr/sbin
:/sbin"
(line separation is to clarify how PATH variables are separating paths)
Notice how mine has /usr/bin:/bin:/usr/sbin:/sbin and yours does not? This is the problem right there. The shell script only finds executables in its path, and while the files are in /usr/bin/, it doesn't find them.
For an SO discussion on Xcode PATH's, see e.g. where is $PATH set in xcode?
Is it possible that your path environment variable is not set somehow?
You have:
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist --convert binary1 Entitlements.plist --outdir /Users/me/path/build/Dist-iphoneos/MyApp.app
While I show:
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/opt/local/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
builtin-infoPlistUtility test34-Info.plist -genpkginfo /Users/gnd/Desktop/test34/build/Debug-iphonesimulator/test34.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -o /Users/gnd/Desktop/test34/build/Debug-iphonesimulator/test34.app/Info.plist
I don't see /usr/bin in your path.
(in terminal:
echo ${PATH}
though most OS X GUI applications get their path from ~/.MacOSX/environment.plist not 100% sure about Xcode though.
Additional Info:
from the 'man bash' page:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
So if you have it in .bash_login but .bash_profile exists, then your change will not be seen.
Also note the comment about the GUI apps PATH definition alternate file above.
You may need to log out and then back in to get the change to "take".
I had same problem.... the problem is that plutil is not in any of the directories in PATH.
My solution was to make a copy from /usr/bin to /user/local/bin which is in the PATH.
No idea if the problem is Xcode, OS X or Apple.
plutil usually resides in /usr/bin. Make sure it's there. If it's not, you may have installed your Developer Tools without unchecking (or with unchecking) the System Tools checkbox, which puts the base Mac OS X programmer tools into /usr.
Tried reinstalling the SDK?
I have gone over the answers provided and none of them worked for me. The problem persisted.
I looked carefully at the error in xcode and notice that it was looking for the image in the wrong place. In my case I had copied and renamed the directory containing my project. None of the references to my images were updated.
I fixed my problem by right clicking the project file in finder and clicking Show Package Contents. I then opened the *.pbxproj in xcode. I did a find and replace on the file to replace the name of the old folder with the new folder.
After closing and opening xcode this solved my problem.
I hope this helps others...
I've seen this error before. The issue lies in a corrupted .png file. The error is pretty deceiving. Try deleting the affected .png and replace it back in your project from a backup or clean version of that file. That should clear up the build errors.
this error will also show if you deleted a file via finder (not in xcode) then try to archive. So make sure that none of your files are listed in red and if they are remove it from your project.