This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 234290 - graphics corruption of margin
Summary: graphics corruption of margin
Status: RESOLVED DUPLICATE of bug 233557
Alias: None
Product: platform
Classification: Unclassified
Component: JDK Problems (show other bugs)
Version: 7.3
Hardware: PC Linux
: P2 normal (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-12 21:15 UTC by Remdul
Modified: 2013-08-21 10:51 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot of graphics corruption (261.26 KB, image/jpeg)
2013-08-12 21:15 UTC, Remdul
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Remdul 2013-08-12 21:15:23 UTC
Created attachment 138615 [details]
screenshot of graphics corruption

Margin/line number/warning icons are horizontally offset, and drawn on top of code; major graphics corruption (see screenshot). Disappears briefly when scrolling the garbage off-screen, but returns as soon as one character in the document is changed. Extremely annoying and makes Netbeans unusable in practice. This is a showstopper. Very surprised no one reported this yet!

Occurs less frequently if the code generates no errors/warnings, but as soon as the Code Assistance starts churning (after user input) the corruption occurs. 

Trivial to reproduce on at least two entirely different machines, one with clean Netbeans 7.3 install. One running Mint 13 XFCE and the other Ubuntu 13 (GNOME Classic). 

I've tried toggling various editor options for a workaround, but didn't find any. If anyone does, please post below!

Info blurb (Mint box):

 Product Version: NetBeans IDE 7.3 (Build 201302132200)
 Java: 1.6.0_27; OpenJDK Client VM 20.0-b12
 Runtime: OpenJDK Runtime Environment 1.6.0_27-b27
 System: Linux version 3.2.0-23-generic running on i386; UTF-8; en_US (nb)
Comment 1 markiewb 2013-08-13 21:05:10 UTC
I would propose: Try 7.3.1 with the newest official Oracle JDK6 (not the OpenJDK one). Does the error still occurs?!
Comment 2 Remdul 2013-08-15 11:48:42 UTC
Thanks for the hint. I suspected the problem was caused by a recent Java update, but I wasn't so sure since after it also occurred with an out-of-the-box clean Netbeans install on the Ubuntu machine.

But it appears the OpenJDK-6 is indeed to blame, I now have a workaround:

1) install OpenJDK-7 [1]:

 sudo apt-get install openjdk-7-jre

2) edit your netbeans.conf [2] to update the path to the new Java libraries
 In netbeans.conf you will find a line saying something like this:

  netbeans_jdkhome="/usr/lib/jvm/default-java"

 (NOTE: on some systems you might alternatively find this file in /usr/local/netbeans-7.0/etc/netbeans.conf)
 Replace this with the path of the OpenJDK-7 new path. For me it became this:

  netbeans_jdkhome="/usr/lib/jvm/java-7-openjdk-i386"

3) Start Netbeans as usual, problem should now be solved!

References:
[1] http://openjdk.java.net/install/
[2] http://www.techytalk.info/netbeans-cannot-find-java-please-use-jdkhome-switch/

To any Netbeans developers: could anyone judge if the JDK is to blame? Should future Netbeans versions detect this issue to warn the user?
Perhaps it is worthwhile to report to the OpenJDK maintainers that a bug was introduced in a recent JDK-6 update. I don't know anything about the JDK myself, and don't know what exactly to report. I did find something which suggests this is a common problem: https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/1204906

See also: another bug I reported [234292] was also fixed by the above solution: https://netbeans.org/bugzilla/show_bug.cgi?id=234292
Comment 3 Remdul 2013-08-15 12:31:26 UTC
Noticed I forgot to add the path at step 2, it should be this on Ubuntu or Mint:

 /home/<USERNAME>/netbeans-7.3/etc/netbeans.conf

You may need super user privileges if the file is located elsewhere (sudo).
If you really can't find it, enter the command "locate netbeans.conf" in a terminal window. Likewise, to find the location of the JDK, type "locate java-7".
Comment 4 Remdul 2013-08-15 12:38:36 UTC
By the way, why does posting comments on this bug forward me to bug #232409 ?! Looks like a bug in the bugtracker (this is so meta!). Note the bug numbers:
23 42 90
23 24 09
Comment 5 Miloslav Metelka 2013-08-19 13:10:46 UTC
OK passing to platform/jdkproblems for further resolution.
Comment 6 Antonin Nebuzelsky 2013-08-21 10:51:47 UTC

*** This bug has been marked as a duplicate of bug 233557 ***