57

My Eclipse javadoc view has a black background which makes it look terrible and partly unreadable (e.g. links are dark blue on black). Even worse, the javadoc popup has black background, too. I can't find the corresponding setting.

The answer by Sumit Singh showed me how to change the background for the javadoc view. However, I still see no way how to change the foreground. Even worse, the javadoc popup background color didn't change.

I don't think it's caused by a plugin, as it happens with a fresh install, too. This happens on Ubuntu 10.4. In Windows the colors can't be changed either, but there are fine.

maaartinus
  • 44,714
  • 32
  • 161
  • 320

11 Answers11

92
Window > Preferences > General > Appearance > Colors And Fonts > Java
> Javadoc View Background  

enter image description here

Sumit Singh
  • 15,743
  • 6
  • 59
  • 89
  • 1
    I must have been blind. It works... however I need to change the foreground, too, and I can't find it either. On Windows I see dark violet text on white background, which is very easy to read, on Ubuntu the foreground color is white which makes me mad. – maaartinus Apr 30 '12 at 12:26
  • 8
    Even worse... the background of the popup stays black! – maaartinus Apr 30 '12 at 12:28
  • 15
    This does not work in Ubuntu/Gnome3, background color stays black despite the Preferences option. – Boris B. Jul 12 '12 at 17:13
  • Plus for informative screenshot, however the tooltip-solution is apparently the correct one. (Xubuntu 13.10) – stolsvik Feb 02 '14 at 21:49
  • This is something else than was asked. This is the color of the javadoc VIEW and not the tooltip! – ACV Oct 18 '16 at 09:54
  • I added the option to customize foreground recently: https://bugs.eclipse.org/bugs/show_bug.cgi?id=501452 With that said, the black/white issue has been resolved in recent builds. (See my answer). – Leo Ufimtsev Nov 09 '16 at 17:33
  • 1
    This answer worked (mostly) in Windows 7 for Eclipse Oxygen.2. It was explicitly set to black, so I told it to use the default, which still resulted in black background. It was necessary to override the background to an explicit color. – Pixelstix Mar 07 '18 at 16:17
  • Works on Ubuntu 18.04 (Gnome) / Eclipse Photon. – Doopy Oct 27 '18 at 14:36
  • Regarding Eclipse 2018-09 (4.9.0) in Windows: Both resetting the background color and manually adjusting it to the default color (defining a custom color like that yellowish default color, that is) failed. In addition to what worked for Pixelstix, I like to point out, that I had to use a system color - plain white in my case. After a restart it 'magically' went back to the (yellowish) default color, which is fine for me (although still a bug, I guess). – MyBrainHurts Nov 25 '18 at 15:24
  • 2
    Had to re-set the background default color, otherwise the value would change back to black (running on macos). Thanks! – Renan Souza Jun 11 '19 at 14:37
  • Thanks for this. Worked for me on Windows 7! – LiemLT Jul 02 '20 at 16:56
24

You need to change the 'Tooltip' color in Ubuntu at the OS level.

Deepak Azad
  • 7,903
  • 2
  • 34
  • 49
  • 3
    That's it.... and [this answer](http://superuser.com/a/198589/64359) solved it for me. – maaartinus May 15 '12 at 14:47
  • 12
    And a line about HOW to do that would be quite nice to supply, IMHO. [Here's a proper explanation](https://plus.google.com/+GianMariaRomanato/posts/WHBrbEyWPZk). – stolsvik Feb 02 '14 at 21:51
  • 1
    This does not work with Eclipse Mars (and later?), but editing `/usr/share/themes/Ambiance/gtk-3.0/gtk-main.css` does. – Peter V. Mørch Oct 29 '15 at 10:30
  • 1
    @PeterV.Mørch Just checked: using the gnome color chooser gave me the expected colors on ubuntu 16.04 with eclipse mars r2 (using radiance theme). – GhostCat May 25 '16 at 07:20
  • @DeepakAzad how to fix it in `Ubuntu 16.04` with `eclipse Neon 1` – Kasun Siyambalapitiya Nov 09 '16 at 12:40
  • With the newer versions of Eclipse, on Linux, Javadoc will no longer use SWT.COLOR_TOOLTIP. Instead it will use the same color as a text list (i.e, white background, black text). See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=501742 – Leo Ufimtsev Nov 09 '16 at 17:31
  • After much frustration over how to change it I finally saw this answer, however on CentOS I selected Adwaita but it still retained the black tooltip background even though I changed it at OS level, but at least the darn thing is more readable now – killjoy Apr 25 '17 at 12:20
18

None of the answers here worked for me (I have Eclipse Mars and Ubuntu 14.04). I had to edit /usr/share/themes/Ambiance/gtk-3.0/gtk-main.css. I've changed tooltip_bg_color to #f5f5bf# and tooltip_fg_color to #000000. After restarting eclipse, the change took effect.

Rafi Kamal
  • 4,522
  • 8
  • 36
  • 50
  • 1
    You saved my day! After digging a bit deeper I found that the style for tooltip can be configured in the gtk-widgets.css file with more advanced options. It works on Ubuntu 14.04 – Next Developer Dec 18 '15 at 19:27
  • Thanks! I changed `tooltip_bg_color` to `#505050`. – Carcamano Mar 03 '16 at 18:05
  • There are some more files that you might need to edit mentioned in this answer: http://askubuntu.com/a/70665/145754 – jmiserez Apr 27 '16 at 14:41
  • This did work, but also effected other applications like firefox. So Dalmocles answer together with the comment from amertkara is by now the only working for me (14.04, Mars). – Murmel Sep 09 '16 at 13:58
  • With the newer versions of Eclipse, on Linux, Javadoc will no longer use SWT.COLOR_TOOLTIP. Instead it will use the same color as a text list (i.e, white background, black text). See: bugs.eclipse.org/bugs/show_bug.cgi?id=501742 Which fixes this issue. – Leo Ufimtsev Nov 09 '16 at 17:34
  • first applied this, but the one below seemed to work better http://stackoverflow.com/questions/28879560/eclipse-black-background-in-javadoc-popup – Spangaer Jan 26 '17 at 17:17
8

As a KDE user you have to change the tooltip background color with systemssttings.
Navigate to

Application Apperearence -> Colors -> Colors

and adjust the Tooltip Background and Tooltip Text colors.

StefanQ
  • 708
  • 10
  • 16
  • This issue has been fixed. Javadoc will no longer use that system setting, instead it will use the SWT.COLOR_LIST color, which is based on a Gtk list (e.g tree in your file browser). See my answer. – Leo Ufimtsev Nov 09 '16 at 17:35
7

On ubuntu 12.10 (quantal) you can use the following two commands:

#foreground white => black
sudo sed -i s/tooltip_fg_color:#ffffff/tooltip_fg_color:#000000/g  /usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-2.0/gtkrc
#background black => yellow
sudo sed -i s/tooltip_bg_color:#000000/tooltip_bg_color:#f5f5b5/g  /usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-2.0/gtkrc

(Thanks to the other answers and this that helped me to figure this out)

Community
  • 1
  • 1
AmanicA
  • 4,659
  • 1
  • 34
  • 49
  • Great answer! helped me so much! – Janning Vygen Apr 26 '13 at 09:23
  • With the newer versions of Eclipse, on Linux, Javadoc will no longer use SWT.COLOR_TOOLTIP. Instead it will use the same color as a text list (i.e, white background, black text). See: bugs.eclipse.org/bugs/show_bug.cgi?id=501742 Which fixes this issue – Leo Ufimtsev Nov 09 '16 at 17:36
7

Install the "GNOME Color Chooser" in Ubuntu (worked also on Xubuntu)

There you can set the Tooltip colors under the tab "Specific"

Damocles_
  • 71
  • 1
  • 1
  • 1
    This is the solution that worked for me on 14.04. Of course, you need to run eclipse `SWT_GTK3=0 ./eclipse` to avoid GTK3 overriding your settings. I am using Mars 4.5.1. – amertkara Feb 10 '16 at 16:15
  • There seams to be a more app-specific solution by specifying the GTK-config file, but i could not get it working, for anyone interested: http://askubuntu.com/a/131348/212893 – Murmel Sep 09 '16 at 14:11
  • With the newer versions of Eclipse, on Linux, Javadoc will no longer use SWT.COLOR_TOOLTIP. Instead it will use the same color as a text list (i.e, white background, black text). See: bugs.eclipse.org/bugs/show_bug.cgi?id=501742 Which fixes this issue – Leo Ufimtsev Nov 09 '16 at 17:36
5

Had same issue with Neon on Ubuntu 16.04 Mate edition.

To fix it, I have created a small, user-specific GTK3 CSS settings file. It is stored as you HOMEDIR/.config/gtk-3.0/gtk.css

In my case, I compressed the spacing a bit, specified default font and also, set the appearance for the tooltip windows:

#####################
* {
    padding: 1px;
    font: Liberation Mono 12;
}

GtkToolbar {
    padding: 2px;
}

GtkMenuBar {
    padding: 2px;
}

GtkMenuItem {
    padding: 2px 6px;
}

.tooltip {
    background-color: #CAE1FF;
    color: #EEEEEE;
    text-shadow: none;
}
#########################
mr.maga
  • 91
  • 1
  • 3
  • This changed the background color for me, but the foreground color stays white, so it is even less readable. Any idea why the foreground color isn't changed? Neon on Mint 18 Cinnamon. – Florian Jan 30 '17 at 17:29
  • This was the only viable solution that worked for me. Eclipse didn't respect any of its internal settings, not the selected theme's css properties. But it did respect the background-color of the local css file! Since, it didn't respect the color property, set in the local css either, I choose #aaaaaa (dark grey) that makes the white text and blue links discernible. This is not a solution only a workaround for those in a hurry to make these tooltips readable! – Angelos Asonitis Apr 18 '19 at 11:55
3

Please note, this issue has been resolved in Eclipse as of 8th November 2016. To have this fixed, please download one of the latest integration builds: http://download.eclipse.org/eclipse/downloads/
(The maintenance builds don't have the patch at the time of writing 2016-11Nov-09Wed).

I wrote a patch that introduced a new preference in Eclipse "Information Background/Text" under General -> Appearance -> Colors and Fonts. This preference generates the correct color on Linux/Gtk (White background, black text).
See: Bug 505738 – Define a information hover color which JDT, CDT or others can use https://bugs.eclipse.org/bugs/show_bug.cgi?id=505738

Subsequently I made Javadoc colors inherit it's color from that preference. See:
Bug 501742 – Default Javadoc text and background color should use colors consistent with Java editor background/foreground. https://bugs.eclipse.org/bugs/show_bug.cgi?id=501742

As an added bonus, it also works on the Dark Theme:
Bug 505851 – [Dark Theme] Style the HOVER_ colors for the dark theme https://bugs.eclipse.org/bugs/show_bug.cgi?id=505851

Leo Ufimtsev
  • 6,240
  • 5
  • 40
  • 48
0

Also try this sudo apt-get install libwebkitgtk-1.0-0 after I installed the lib the javadoc looks so much better

After installing brand new Eclipse, you may notice, that hover, which shows javadoc comments, and Javadoc view render javadoc comments as a plain text. Eclipse simply ignores all the @link and @see annotations. Well, it's actually not the problem of view itself. The problem is that default Eclipse browser is not working from the box in Ubuntu 12.04. To make it works you need to install libwebkitgtk-1.0-0 package. Just type in the terminal:

source: http://ubuntu-user-tricks.blogspot.com/2012/09/3-things-to-do-after-installing-eclipse.html

Ismail Marmoush
  • 13,140
  • 25
  • 80
  • 114
0

I think the answer here to have a properly formattet tooltip (at least for people who use ubuntu and want to have a nice hover tooltip) with html elements like links working is to install libwebkitgtk as it is used by eclipse to show javadoc. It is not preinstalled on e.g. Ubuntu and does not come with eclipse.. use:

sudo apt-get install libwebkitgtk-1.0-0

and restart eclipse to have good looking tooltips.

tObi
  • 1,864
  • 3
  • 20
  • 32
-2

You can change the color in
Windows->Preferences->general->Appearance .

Sumit Singh
  • 15,743
  • 6
  • 59
  • 89
Vishnu
  • 70
  • 2
  • 12