Eclipse not pasting copied text (Java/Mac) - java

I am having this weird problem where when I select text (Cmd-C) and then try to copy it to another location (Cmd-V) it behaves as though it wants to copy the file as if I had the file name selected instead of the text. Trying to paste in a text window pastes the file itself, so it's clear the copy is what is at fault. Trying the menu option to copy (Edit->copy) does the same thing, so it's not a key interpretation issue.
This started happening to me after I had closed eclipse and then re-opened it later. No settings had been changed. A related issue that cropped up that might help identify is that eclipse stopped showing the file/line that the stack trace was on in debug mode (break points work, just doesn't pick up the file/line #). If you right-click on the stack trace item and tell it to go to the source code - it does, and appears to look correct, it just doesn't do it automatically when you hit the breakpoint. Both issues started happening after the restart.
Both are equally disturbing - but this post is primarily about the pasting issue.

The debug trace issue happens to me too. I close Eclipse, then delete the ".metadata\.plugins\org.eclipse.jdt.core" folder in the associated Workspace, then restart. This clears the cache.

Related

Highlighting files changed on a branch in Intellij IDEA Project section (similar to uncommitted changes)

In IntelliJ IDEA is there a way to highlight the files changed on a current branch (i.e. all files changed in your previous commits) in the project section?
Obviously the git/history tab can be used to see the files but it is pretty cumbersome as it opens the diff instead of the actual file.
It's nice to just be able to quickly see the files you've been working with show up a different colour. I usually hold off on committing my changes until I'm nearly finished on something just so I can easily see the files I've been working with recently.
See whether this works for you.
Open Git history, click one of the commit, then on the right page, right click and select "Edit Source", it will open all the files that were changed/updated/added on the Tab editor.
In IntelliJ IDEA is there a way to highlight the files changed on a current branch (i.e. all files changed in your previous commits) in the project section?
Currently, there is no option to set scope in Local Changes to a particular branch, please see and feel free to vote:
https://youtrack.jetbrains.com/issue/IDEA-161465

Eclipse Debugger not following the source code

I have encountered a problem with the Eclipse and I am unsure how to fix it. When I enter the debugger and press the step over button the debugger usually highlights the line of source code that I stepped to. However, for some reason this is not working for me anymore. I enter the debugger and go to the breakpoint but if I hit the step button the source is not highlighted and if I continue to hit the step button I can see that the Debugger is stepping into other files (looking at the Thread) but my view of my code doesn't change. The only way I can find what line my Debugger is on is if I control click on the line from Debug tab and click Lookup Source which then highlights the line the Debug Current Construction pointer is on. If I am debugging I would like to follow this Current Construction pointer line by line. I must have accidentally altered this somehow and I am unsure how to change it back.
Simply stated the problem is this, usually the Eclipse Debugger highlights your source code as you step through it. It is not doing that for me anymore, the debugger is stepping properly but it is not highlighting the line of code that it is on.
This happens when we make Java code change in file, compiler creates a class but running server has a old copy of your class file.
Go with JRebel to get rid of such kind of issues.
This can also happen if you have more than one project in you work space, and you create a debug configuration that points at the wrong project base directory.
To resolve this:
Open your debug configuration list (Run -> Debug Configurations)
Select the proper configuration under your Remote Java Application list
Verify that you have the correct project source listed under the Base directory on the Main tab.
If you have the wrong directory selected (say, one that holds a different project), the debugger will start with no issues, but you will not be able to step through your code.
I had the same issue.
There was a workaround for that by right-clicking on associated callstack line in Debug view and selecting "Lookup Source". After that the current instruction line is (green) highlighted as usual. But I needed to do this after every debug step.
Rebuild all projects didn't help.
The solution:
Restart Eclipse and all works fine.

How to restore shelved changes in Intellij when the shelf tab is not shown?

I tried to use the "shelf" feature for the first time in IntelliJ IDEA today. I shelved all my current changes so that I could work on a quick bugfix, commit it, and come back to my current work afterwards.
When I commited the "shelf" action, IntelliJ created the shelf and I could see it in the tool window. Then it reverted, and reloaded the project.
Now the shelf tab in the Changes tool window does not appear any more.
However in the file system I can see the patch file under .idea/shelf.
Why ? I suspect the problem is that the .idea directory is itself under version control. So when I shelved the changes, it file was included in the shelved changes, and then it was reverted, and IntelliJ is not aware of the shelved changes any more.
I am using Git.
How can I make IntelliJ aware of the patch file in the change tool window ? Or if impossible how can I restore these changes based on the patch file only ?
And how to use this feature in the future without encountering this problem ?
Is it a bad practice to keep the .idea directory in te VCS ?
The answer to the
How can I make IntelliJ aware of the patch file in the change tool
window ?
question was :
Create a bogus shelved change so that the "shelf" tab is available. It will not show if there are currently no shelved changes.
Right click in the "shelf" tab, select "import patch file", pick the previously create patch file. This creates the "shelf"
You can now "unshelf" the changes normally
Finally, I had to manually merge the workspace.xml file. After this, I think I will think about stopping to commit IDE project files to VCS. At least when it is a trivial task to recreate the IDE project from e.g. a checked out Maven project.
If you are ever lose the Shelf tab in a Jetbrains IDE, you may have shelved too large of a file (a 1.81 GB .patch in my case). You can view all of your patches in the Jetbrains shelf by going to:
/.idea/shelf
Delete the really large patch file and restart the IDEA and the Shelf tab reappears on the Git area .
If you don't see your .idea folder in your IDE, follow these steps:
Help > Find Action...
Search "Registry" and click the found action
In the Registry search "dot.idea" and uncheck the checkbox in the Value column for the projectView.hide.dot.idea Key
I had similar issues, but shelving bogus changes did not help (was using WebStorm, but the underlaying IDE is the same). The shelf window did not show up no matter what I did. Even though the shelved changes were created in the .idea/shelf folder. What actually in the end helped was moving/deleting .idea folder under the project completely (good to backup before deletion). And restarting JetBrains IDE.
For anyone (like me) still running into this issue:
The shelf tab is most likely there, but not displayed due to the width of the commit tab.
In the top right of the commit tab there are 3 icons:
arrow down
cogwheel
minimize
On the ARROW DOWN you see all the "hidden" tabs, which includes the tab "Shelf" for me.
Or you make the commit tab wider then you should also see the tabs at the top.

netbeans runs program even if there are errors in code

so, I accidentally chose "don't show me this message again" and "Run anyways". is there a way to undo this setting? Like there can be typos throughout the program, and it'll still try to run. I don't want this, because if there's a section of code that might not be called while i'm testing the program, I might not notice the error.
newest version, 7.4 NetBeans EE for windows
if a function call is actually made to the "uncompilable source code", then it gives such an error
I can search through the program manually line by line, making sure there are no red squiggly lines, but this seems impractical. perhaps I should just re-install netbeans?
According to multiple posts on the Internet, you should remove the BuildArtifactMapperImpl.properties file in the <netbeans home>/<version>/config/Preferences/org/netbeans/modules/java/source/ directory (where it is depends on your installation).
It should have the askBeforeRunWithErrors property set to false. Some just fixed buy deleting the whole file.
Personally, I do not have that file but I have not checked that option, so it might be generated at that point.
how about you delete the settings file stored in the your user DIR as an xml file. it will reset netbeans bac to defaults. or you can edit it and locate parameter askBeforeRunWithErrors to false as it's set to true.
There is a red stop button in the output window. Click that.
There is a bug in NB forum. And another forum reply says that
Don't bother - found it after making a directory diff :
Simply remove the file
.netbeans/7.0/config/Preferences/org/netbeans/modules/java/source/BuildArtifactMapperImpl.properties

Eclipse edits and saves don't make changes to running program - powercut

So I was busy writing away in eclipse when there was a power cut. Luckily I had been saving regularly and so when I got back on I still had all my work.
However after writing a few lines and running it and spending a while trying to figure out why it wasn't working I realized that whatever I wrote didn't change what ran. I could even comment out bits of code OR EVEN the entire program OR EVEN YET DELETE LINES OF CODE, yet it still runs as if the same code was there from before the power cut. In the file menu all the save features are grayed out, yet if I control S and restart my pc or restart eclipse then it has made changes to the code and saved however the new code has made no effect on anything and still runs as before.
Has anyone else experienced this?
Has eclipse got some auto save feature for problems such as power cuts in order to prevent work less?
Has this put eclipse in a special mode that I can exit back to the normal mode?
When issues like this happen, the first thing to do is to click on Project -> Clean in the main menu.
The Project was corrupt.
Solution
Copying classes across into a new project and deleting old project.
Try restarting eclipse. Perhaps it kept some content in the editor but the link was broken from the actual file that it's building. Maybe copy your code just in case the file is out of sync with the editor.
My problem was the folder was in a different workspace, so the old version of my file was in there, but my newer saved version was in a different workspace. I didn't realize the newer version was somewhere else. This happened because I need to send files back and forth from my main computer to my laptop for school, then return the folder again. So be extra aware of your workspace locations! If you export a project from Eclipse, it will always choose one by default, but you can choose another in the export menu.

Categories

Resources