Eclipse console error link sending me to wrong project - java

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.

Related

Error in the Log File of Eclipse

I've searched for a solution to this problem all over stackoverflow and other sites, but I couldn't find a solution that addresses this particular error. Eclipse fails to launch, with an error in the log file which is like that :
"An erroe has occurred. See the log file
C:\Users\dell\Desktop\Apps\adt
bundle\adt-bundle-windows64bit\adt-bundle-windows-x86-20140702\eclipse\configuration\1507118079036.log."
So please, can you help me to solve this problem? ( as I am totally new to Eclipse and Java )
Try this: Delete the .snap file
YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/.snap
For example:
E:\Sankalp Gupta\JAVA\JavaPractice\.metadata\.plugins\org.eclipse.core.resources\70.snap
Error in the Log File of Eclipse
Fallow these simple steps to resolve eclipse launch problem.
Step 1: Quit eclipse
Step 2: GO to your workspace and delete .metadata folder in your YOUR_WORKSPACE
For example, YOUR_WORKSPACE folder like C:\Users\SamDev\workspace
Step 3: Start eclipse & Choose same workspace or New( You will see as a new workspace created) , It solve your eclipse launch problem.
I had the same issue but I tried the following and it resolved the issue:
Go to the eclipse directory.
Open the command prompt.
Run the eclipse -clean command.
Eclipse should work fine now.

the type of out is erroneous

I'm working on a java project in Netbeans 8.2. And suddenly, I started receiving errors whenever I type :
System.out.println();
System.err.println();
Error shows : The type of out is erroneous ( same goes for err)
Also, when I tried
import java.io.PrintStream
an Error shows that PrintStream doesnt exist in package IO.
What should I do to resolve this problem ? and is there any replacements for System.out.println()
Same error occurred to me as well, but it was when I would copy-paste some code and some lines would throw such error, I found out that deleting cache can fix error. First close netbeans, and go to cache folder.
Cache folder is located in C:\Users\"YOUR USERNAME"\AppData\Local\NetBeans\Cache\
But you can also copy address from netbeans, go to help -> about and you will see Cache directory
Inside Cache folder you will find another folder which name is version of netbeans, in your case it should be 8.2, just rename this folder to something different because you want to keep it for case something bad happens, then run netbeans and it should create new folder called 8.2, if everything is working properly you can now remove renamed folder and continue with your work.

Source not found when debugging on server (Eclipse)

I'm developing a web service, and whenever I try to debug on server this is what I get, even though if I run on server everything goes fine!!!
I've been stuck on this now for 2 days !!!
Thanks for the help guys.
UPDATE
clicking on change attached source shows:
The Eclipse debugger needs the source code of what's executing on the server. Typically, you can download the source online as a jar or zip, then save it somewhere on your machine. Then click "Change Attached Source" and point to the downloaded source jar or directory where the zip was extracted.
~NCM
Finally after 3 days stuck on this, all I had to do is to Remove all break points by going to
breakpoints view -> Right click on any breakpoint -> remove all

Eclipse server configuration messed up terribly

In Eclipse, while adding a new server, I accidently added a 'project' as a resource to the server. Now, in all my servers, this project (which I've already deleted from hard disk) appears as a resource, and I can't get rid of it. Here's a screenshot, shown when I try to Run the project and it asks me to select the server:
I've tried to reinstall Eclipse, switch workspaces, but I can't get rid of it. Because of this, I'm getting a lot of errors whenever I try to run even a sample app. How do I get rid of this 'resource' and just start over?
Try clicking on the test and do remove as you have shown in the screenshot or delete the server and define new server..

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