Message in Eclipse: "The file cannot be found" - java

I don't understand why is this happening, but as soon as I click "Aceptar" Eclipse minimizes and is impossible to work on that way. It started happenning since I started renaming some components but I don't think this could be a problem, wouldn't it? Does any of you know why this happens? Because I need to finish this project for an exam and I still have lots of things to do. Thanks in advance

you renamed your components, what do you mean?
Did you change class names? Did you change filenames?
If one of the above is correct you should refactor the names.
Classname must be identical with your file name.
If it isn't the case you ought to post the code that you have changed, which caused the ongoing problem.
:) have a nice day

Related

File not in same subdirectory or sourcepath?

I am new to Java and this is my essay to pass java. I found a template that I want to test, but the error is too strange for me to understand.
I must work in Netbeans ID 13 and the picture shows it all. But to me... I have the idea that I have everything on the same place. See here
I hope someone can help me to get on the right track.
Make sure the package and the directory names are both in lowercase. So 'com.mycompany.test1' not 'com.mycompany.Test1'. If the java source files are in the same package, then an import is not needed.
There might be something wrong within Options.java too. If so, please share the source code of it.

Eclipse - renaming a package got rid of a bunch of stuff, is there a way to recover it?

So I made a package, lets call it dev.example.project for example purposes. all my other packages extended off of that one, with names like dev.example.project.handler or dev.example.project.assets. But I decided to go back and change the dev.example.project package's name to something else, like dev.betterexample.project.
I thought it would be a simple matter of renaming all the other packages and import statements so no errors would happen, but right after i changed the name, all the packages in my project turned white and became inaccessible. I changed the name back to what it originally was, but when i opened Eclipse again, some packages and files were simply not there.
I spent a lot of time on this project, someone help?
Depending how exactly you did that renaming, various things could have gone wrong.
Remember: you can always go in and work outside of eclipse. Close it, open a file explorer and create directories that use the names you want to use. Then move files manually to their target directories. If you want to, open them in another text editor and fix the package lines. When you now open eclipse, do a refresh and full rebuild. Things should be fine then.
That is probably not the most elegant solution, but it always works. And more importantly, you are in full control of everything that happens!
And for the record: the real answer to avoid catastrophic loss of code is to use a source code management system such as git. And to then push your changes constantly out to that "backup" facility.

net beans Modules can't start

So I downloaded net beans C and C++ pack, and when I first opened it, it showed this warning message:
It works, but I want to fix this problem because it might do some problems in bigger programs I will create.
I have also tried to go to the link that was in the warning message that I posted here, but I really did not understand anything in there so it didn't help at all.
So if anyone knows what the problem is, and how to fix it, please tell me.

Eclipse plugin "Operation not enabled"

I'm struggling with Java Refactoring - I need to write an Eclipse plug-in which will refactor some code. It's really difficult for me and it would be way easier if I could follow working code step - by - step. The only alike example I could find is a sample Introduce Indirection.
Unfortunately I cannot make it actually work. I get "chosen operation is not currently available" information anytime I try it.
I've imported code, "Run As -> Eclipse App" and than tried to use Introduce Ind. from Eclipse Articles. What am I doing wrong?
I'll be happy with any help :).
Check your handler class for isEnabled() method. I suppose when creating new handler the default value for this method returns false. That can be the issue.
You should be able to get that example (as written) working, or perhaps you need to open a bug. When you start their example in Run As, is there any errors in your error log?
Something else you can try is to look at some of the workbench refactorings. See org.eclipse.ltk.internal.ui.refactoring.actions.MoveResourcesHandler which sets up the move resources refactoring, and http://wiki.eclipse.org/FAQ_How_do_I_find_a_particular_class_from_an_Eclipse_plug-in%3F if you need help tracking down the SDK classes using CTRL+SHIFT+T
I've managed to run it. For others who'll face the same problem:
Check the basics:
Remember that you can chose only one method and:
It must exist in the model (http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/IJavaElement.html)
It must not have any errors
Must not be a constructor
Must not be connected to annotation declaration
And:Select a Java method in the editor outline or the Package Explorer
And it gets obvious :)
The action handler class should be impediments with related interfaces (Check for error console for identify what are the missing interfaces, most probably this would be 'IActionDelegate').

IntelliJ inspection -- non-thrown exception

This is a follow-up question to 1832203. I'm making it a new question as well, because it seems that posting an answer to a question doesn't change its position on the java page and so I'm worried that it won't get seen. Apologies if I've just stepped on some etiquette toes.
I'm an IntelliJ newbie -- started using it two days ago and I'm absolutely head-over-heels in love! One of the things I adore is the code inspections. However...
In one of my classes I often create exceptions without throwing them. If I can't turn off (or downgrade) the inspection warning for this then I can see I'm going to end up ignoring inspections on at least that file (if not the entire project), which would be a real pity.
I've done a search in the inspection settings for "exception", and found nothing that relates exactly, so I turned them all off just to see, and it's still doing it (even after a rebuild...BTW when are inspections redone? at save? at rebuild? ???), so I would really like some help on how to make this one into an info/typo level -- which I can then ignore.
Using the free version, if that makes any difference
TIA to all those experienced IntelliJ warriors out there!
Press Alt+Enter to show inspection popup, then press Right Arrow to see available options. You'll see there options to suppress this current instance of warning, for this class or completely turn it off.

Categories