Bug 188643 - Can't copy text between Netbeans and external applications
Can't copy text between Netbeans and external applications
Product: platform
Classification: Unclassified
Component: Text
PC Linux
: P3 with 6 votes (vote)
: 7.3
Assigned To: Miloslav Metelka
Depends on:
  Show dependency treegraph
Reported: 2010-07-13 23:11 UTC by juan_au
Modified: 2013-08-19 12:44 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description juan_au 2010-07-13 23:11:13 UTC
copy ctrl+c doesnt copy anything to the clipboard, only works inside the netbeans application but cant use ctrl+c to copy to use the text in any external application.
Comment 1 TrombaMarina 2011-02-03 21:52:35 UTC
I having this problem with NetBeans 6.8 and Ubuntu 10.04. When I copy from NetBeans I cannot paste to Gedit or Gnome Terminal (but I can to Emacs and OpenOffice). 

Since some applications work (Parcellite, OpenOffice, Emacs), the system clipboard must know about the copying and pasting done in NetBeans. Deadite81 suggests it's maybe not in the right format or not marked as text:

I also read that NetBeans has some code to avoid deadlock when you are debugging an application and you pause the app you are debugging in the midst of a copy or paste operation and that this code is what causes the problem: 
Source: http://netbeans-org.1045718.n5.nabble.com/Can-t-copy-paste-in-ubuntu-terminal-td2957720.html

That makes sense, but for the rest of us, the rest of the time, maybe we could have a configuration checkbox called, "I know I'll be sorry if I try to debug a GUI app, but use the system clipboard anyway."
Comment 2 jyeary 2011-02-04 14:09:54 UTC
This has been brought up by members of my JUG/LUG community. It is not a P2 bug, but does affect usability of the application. It prevents use of other tools in combination with NetBeans.
Comment 3 TrombaMarina 2011-02-04 19:29:20 UTC
Verified still an issue with Netbeans 6.9 and Ubuntu 10.10.  None of the following will copy code from Netbeans for pasting into a terminal window:
Edit: Copy
Right-Click: Copy

Hmm... Interestingly, now they work on Gedit.  I don't have a problem cutting and pasting any other application to the terminal window.  I wonder if the problem is with NetBeans or with GNOME Terminal?

1.) Highlight text in NetBeans
2.) Middle-click in GNOME Terminal to paste it there

I was trying out editors yesterday and *almost* discounted NetBeans immediately when it failed to cut and paste the way I expected it to.  From a first-impression perspective I'd still say this deserves to be fixed, but for me personally, it's a much lower priority now that I have a good work-around.
Comment 4 Petr Jiricka 2011-03-01 16:15:49 UTC
Reassigning to editor.
Comment 5 David Strupl 2011-03-07 16:00:08 UTC
I am on Ubuntu 10.10 and it works for me.

If we want to resolve this we would need to know the exact JDK version used and whether plain java application (e.g. plain swing text editor) work ok. It might be problem of JDK vs the rest of the OS. Only in case it is NetBeans specific we might want to try to tackle this - if there is a way to reproduce here.
Comment 6 sssilver 2012-02-09 16:02:36 UTC
Still getting the issue on Gentoo/Openbox. Running pretty much the cutting edge versions of everything.

Product Version: NetBeans IDE 7.1 (Build 20120119-unknown-revn)
Java: 1.6.0_22; OpenJDK 64-Bit Server VM 20.0-b11
System: Linux version 3.2.5-gentoo running on amd64; ANSI_X3.4-1968; en_US (nb)

Pasting to some editors (like gedit) and then copying from there works OK. pasting in the browser textareas does not work. Pasting in the browser address bar works.

I guess it's a formatted text vs plain text issue.
Comment 7 pavon 2012-03-09 19:02:04 UTC
I just upgraded to 7.1 from 6.9 and am having this problem. Text I copy in other applications can't be pasted into Netbeans and vice versa. My system information is:

Product Version: NetBeans IDE 7.1.1 (Build 201203012225)
Java: 1.6.0_21; Java HotSpot(TM) 64-Bit Server VM 17.0-b16
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)

So it's not limited to Linux/X11 systems (or there are multiple bugs with the same symptoms).
Comment 8 Svata Dedic 2012-03-12 13:58:37 UTC
(In reply to comment #6)
> Pasting to some editors (like gedit) and then copying from there works OK.
> pasting in the browser textareas does not work. Pasting in the browser address

What browser ? 

I've tried to copy a portion of java code from NB to:

* LibreOffice spreadsheet
* Chromium text area
* Kosnole (KDE terminal emulator)

everything worked OK.

My environment is:
* Ubuntu Linux 11.04
* Linux 3.0.0-11-generic #17-Ubuntu SMP Sat Sep 10 13:38:59 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
* Netbeans dev (20120312)

Could you please give an example of what are you trying to copy that cannot be pasted ?
Comment 9 sssilver 2012-03-14 15:37:10 UTC
Now it works!

Product Version: NetBeans IDE 7.1.1 (Build 20120306-unknown-revn)
Java: 1.6.0_24; OpenJDK 64-Bit Server VM 20.0-b12
System: Linux version 3.2.1-gentoo-r2 running on amd64; ANSI_X3.4-1968; en_US (nb)

I wonder what's changed.
Comment 10 TrombaMarina 2012-03-14 16:28:22 UTC
When people say "copy and paste" they need to be specific if they want others to be able to duplicate the issue.  Some old *nix-heads use "paste-primary-selection" where they highlight some text in one app, then hit the middle mouse button in another app.  In my experience, when paste-primary-selection works (some apps don't support it, or support it differently), it works in NetBeans.  I do not think that's what this bug is about.

This bug report has to do with using the system clipboard, not primary-selection.  Using the keyboard, that's CTRL-C in one app, then CTRL-V in another.  For mouse junkies: Right-click Copy in one app, Right-click Paste in another.

Bug reporters need to be specific which copy/paste method they are using (primary-selection, CTRL-C/CTRL-V, or Mouse menus) and whether NetBeans is the source or destination app for the failed copy/paste.  People trying to duplicate the issue might want to try all three methods in both directions.
Comment 11 melb 2012-04-01 16:58:54 UTC
Setup is a completely fresh installation of 7.1.1 ( All ) on XP SP2, and a new blank SE project.

My first Copy and Paste of code ( text ) from a Firefox page was OK.

My second Copy and Paste, wholly within Netbeans, of code from the first copy and paste was also OK.

However, my third Copy and Paste fails. I copy some more code from another Firefox page - I see in Notepad that it has been copied OK - but it will not Paste in Netbeans. The code from my second Copy and Paste gets pasted instead. I've tried Edit/Paste, Keyboard Shortcuts and Mouse - same result with all methods. The fault is solid.

However, I was close, but did not give up with Netbeans and did something else and now can cut and paste OK!

The reason why I reported this is that this Cut/Paste sequence reproduces the problem to order.

Comment 12 conner_bw 2012-05-03 15:11:05 UTC
Happens to me, too.

I cannot copy paste from Netbeans to the Terminal.

Copying from Netbeans to gedit works fine, though.

Netbeans 7.1.2
Ubuntu 12.04 LTS
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu2)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
Comment 13 Jiri Prox 2012-05-04 07:21:10 UTC
Maybe related to issue 205697
Comment 14 Stanislav Aubrecht 2012-05-04 08:00:43 UTC
Please reopen if this problem is reproducible also with Oracle JDK, thanks.
Comment 15 mrucis 2012-05-23 09:24:08 UTC
Had same problem on NetBeans 7.0 and Ubuntu 10.04 now using Ubuntu 12.04 and NetBeans 7.1.2 same thing.
Now using java:
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)
Comment 16 mrucis 2012-05-23 09:25:59 UTC
Had same problem on NetBeans 7.0 and Ubuntu 10.04 now using Ubuntu 12.04 and NetBeans 7.1.2 same thing.
Now using java:
java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)
Comment 17 Stanislav Aubrecht 2012-05-24 08:21:13 UTC
Please provide exact steps to reproduce and reopen, thanks.
Works fine for me in: 
Product Version: NetBeans IDE 7.1.2 (Build 201204101705)
Java: 1.6.0_32; Java HotSpot(TM) Client VM 20.7-b02
System: Linux version 3.2.0-23-generic-pae running on i386; UTF-8; en_US (nb)
Comment 18 waynebeast 2013-02-28 20:33:42 UTC
I am running Netbeans 7.2 on Win7 64-bit. The problem only happens once in a while. I am not sure the exact steps to reproduce this problem. This has happened to me when copying from VirtualBox, Notepad, Notepad++, Chrome, Firefox, LibreOffice. Example: today, I was trying to copy a bunch of data from LibreOffice to Netbeans, the data that I previously copied inside Netbeans shows up when I did the paste action. I tried pasting the LibreOffice data into Notepad and the expected data showed up. I tried copying the data from Notepad to Netbeans, still did not work. So it seems that the data in the Windows clipboard is not being syncrhonized with Netbeans' clipboard.
Comment 19 waynebeast 2013-02-28 20:37:33 UTC
I just restarted Netbeans, now copy and pasting works again. This is the system info:

Product Version: NetBeans IDE 7.2 (Build 201207171143)
Updates: Updates available
Java: 1.6.0_26; Java HotSpot(TM) 64-Bit Server VM 20.1-b02
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\...\AppData\Roaming\NetBeans\7.2
Cache directory: C:\Users\...\AppData\Local\NetBeans\Cache\7.2
Comment 20 Stanislav Aubrecht 2013-06-04 15:14:40 UTC
Please reopen if reproducible in NetBeans 7.3 or in recent dev builds, thanks.
Comment 21 talsibo 2013-07-25 11:28:54 UTC

I have the same issue when I copy some text from netbeans and try to paste it using Ctrl + v to other application both freezes netbeans and chrome, netbeans and texteditor.

here is my system Info:
Memory: 3.8 GiB
Processor: Intel® Core™ i7-2620M CPU @ 2.70GHz × 4 
Os type: 64-bit ubuntu 12.04 LTS
Disk: 121.9 GB 34 GB free

Product Version: NetBeans IDE 7.3 (Build 201302132200)
Updates: Updates available to version NetBeans 7.3 Patch 2
Java: 1.6.0_27; OpenJDK 64-Bit Server VM 20.0-b12
Runtime: OpenJDK Runtime Environment 1.6.0_27-b27
System: Linux version 3.5.0-37-generic running on amd64; UTF-8; en_US (nb)
User directory: /home/tal/.netbeans/7.3
Cache directory: /home/tal/.cache/netbeans/7.3
Comment 22 ulfzibis 2013-07-25 12:18:56 UTC
Hi talsibo,

why didn't you reopen the bug?
Comment 23 talsibo 2013-07-28 10:50:02 UTC

I wasn't sure I am allowed to reopen it as a bug after your question I was realized that I should reopen this bug.

please note that this issue suddenly appeared after I was updating ubuntu.
I use netbeans for PHP development and really like it this issue is very annoying because it causes to all my system to stuck, for example if I try to do copy and paste from netbeans to chrome both get stuck, chrome and netbeans.

Do you have any suggestions of how can I help resolving this issue?
(providing logs..)
Comment 24 gloin 2013-07-30 12:13:21 UTC
Had the same issue with Ctrl+C and Ctrl+V (while pasting with middle-mouse button worked fine) this morning, probably after system update. It affected Netbeans 7.2 and Netbeans 7.3.1.
Seems it was a problem with OpenJDK 6

However, I could resolve it with the following steps:
1. In Synaptic, I installed openjdk-7-jre
2. In ~/netbeans-7.x/etc/netbeans.conf changed the line

For completeness, my current configurations:

Netbeans 7.3.1
Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.7.0_25; OpenJDK Client VM 23.7-b01
Runtime: OpenJDK Runtime Environment 1.7.0_25-b30
System: Linux version 3.2.0-51-generic running on i386; UTF-8; de_DE (nb)

Netbeans 7.2
Product Version: NetBeans IDE 7.2 (Build 201207171143)
Java: 1.7.0_25; OpenJDK Client VM 23.7-b01
System: Linux version 3.2.0-51-generic running on i386; UTF-8; de_DE (nb)
Comment 25 Miloslav Metelka 2013-08-19 12:44:25 UTC
If NB got stuck you could possibly provide a thread dump e.g. with jstack and attach it to the issue.
Since changing JDK helps to resolve the problem I mark the issue as invalid.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo