The selected file is a system file that cannot be modified - java

I started getting the following error in RAD 9.1.1(websphere 8.5) since yesterday. Also this error is coming on only one project in my workspace. I do have about 7-8 projects which are clean- no errors. Any help or input on this is appreciated..
The project was not built due to "Internal error - the selected file
is a system file that cannot be modified. It will be hidden.". Fix the
problem, then try refreshing this project and building it since it may
be inconsistent

Issue resolved, goto Target, compiled classes folder of that project and DELETE copyarea.db and refresh your project. The error is because the RAD copies the read only files ".copyarea.db" to the classes folders and during cleanup, RAD fails to delete these files.

Related

FileNotFound exception after fetch, even though file exists in VSCode

I'm currently using GitHub desktop to fetch changes, and then opening the project in VSCode.
For whatever reason, any new files that come with the fetch throw FileNotFound exceptions after compiling (even though I can see the files in the project folders). If I go into a file, make an edit and save it the issue goes away and the compiler sees the files again.
Is there a way to "Refresh" the project files after a fetch. I am assuming a file pointer isn't resolving in some backend code somewhere.
Any advice is appreciated
Open Command Palette and choose Java: Clean Java Language Server Workspace then reload window.

How can I clean up my eclipse project after deleting a .java whose .class file still seems to be somewhere?

So, I deleted a couple of .java files from within eclipse because I didn't need them anymore. However for some reason another class still uses them and compiles without a problem. When I go to the declaration of the constructor of one of the deleted classes a .class file opens of that class even though I thought they got deleted by eclipse when I deleted their .java files.
I have tried to clean the project and I tried to find the .class file using the system file explorer in the folders that are listed in
project > properties > resource > linked resources. However I couldn't find them.
Now, since I deleted those files/classes there should be a compile time error wherever they are used but everything compiles without an error, even using the code that should've gotten deleted. A colleague that recently joined the project does receive compile time errors, since he doesn't have those class files. And I want to get them too, so I can fix the code where the classes were used. Of course he could show me the lines of code that are affected but if this happens again he would probably be affected as well as he would have the class files by then.
Try doing the following
Go to project > properties > Java Build path >Source
under that you can find Default Output Folder section, simply delete the classes folder under that location with in your project.
Try cleaning the project.
Or
Simply close the eclipse and reopen it again, sometime this would work for me.
Hope it resolves your problem
If you just deleted the sources, they binaries would still be there. So open the Navigator View and go to the project in question. Look for the bin directory and delete the appropriate class files. Otherwise, delete the project itself.
You should also ensure that no other programs depend on those class files.
I found the problem. Someone built a .jar file I didn't know of which contained a lot of old code.
I found it by right clicking the constructor and selecting
references>project

Eclipse console error link sending me to wrong project

I have a web site project in Eclipse and I needed to copy it and rename it for a new client. So I had my tortisesvn export the site to a new directory and changed the project name in the .project file and imported it into the same workspace in Eclipse. It seems to be running ok but now when I get errors in the console window the links that should take me to the line of the error take me to the file in the original project not the new one. Anybody know what I can do to fix this?
EDIT: In case anyone asks. I'm sure it's using the correct file when running the site and the error number is on the correct line. I put an intentional divide by 0 error in my code to test this and I get the expected error in the console window on the line that the error is on but it still sends me to the same file name but in the other project.
I found this one with some more searching: Eclipse opens wrong source file on exception
It seems if I remove the other project from the server in tomcat it goes to the correct spot. What a pain.

Can't compile due to missing files

I get the following message:
The project was not built due to "File not found: path/.DS_Store.".
Fix the problem, then try refreshing this project and building it since it may be inconsistent
This is a error message I've never seen before. I'm running Eclipse Indigo on a Mac OSX with Lion. As far as I understand the message my .DS_Store file is responsible for me not being able to compile, but how can that file mess with my code?!
Maybe what's interesting or not:
My file structure is as follows:
com.packagename
And it says File not found: bin/com/.DS_Store. It can't find the .DS_Store file in my binary output folder?
Try to refresh the project in the Project Navigator (F5 or Right click/Refresh).
These error messages are most likely caused by modifications in the file system outside Eclipse (e.g. external builder, or vcs tool is used), and Eclipse detects during the build that the file is changed.
Alternatively, if you are using a recent enough Eclipse, you could try two settings in the Preferences that might help in these cases as well: check Refresh using native hooks and Refresh on access in General/Workspace page in the Preferences dialog.

Eclipse run old version of program

I have a problem while runing my application in eclipse. I make some edits like this:
String res = "newvalue";
System.out.println(res);
But when I run the application I still receive "oldvalue" in output. After this I tried to delete main() function - and I run application and I see "oldvalue" in output again.
Maybe it's some cache in JVM, or smth. else?
UPD:
It's 15:35 on my clock now. But in /bin folder I see .class files with 14:33 timestamp. I change source files (.java), press ctrl+f11 in eclipse and files in /bin folder are still 14:33 ...
UPD2:
After cleaning the project I receive the following problem:
The project was not built due to "Could not write file: D:\projects\NelderMead\bin\ru.". Fix the problem, then try refreshing this project and building it since it may be inconsistent
SOLUTION
The problem was that eclipse can't write file to the folder with spaces and UTF chars in it's name. So, I copy project to the new clean workspace and it runs without problems! Thx all for help detecting the problem!
You're executing an older class files, the reason could be
a compile error somewhere else (see problems view)
or your changed accidentally the source path so that the new source no longer gets compiled.
Try to clean the project and make sure the new classes are compiled to your output folder.
The JVM doesn't have a cache for class files.
First, make sure the file is saved (there is no asterisk next to the file name in the tab). Usually files are saved automatically, but you could choose not to save files and never ask by mistake, the first time Eclipse pops up this dialog.
Then see what's going on in the Problems view. You might see something like project cannot be built due to the following reason. It may be because of compilation errors in the dependent projects.

Categories