I try to change the font size of package explorer in Eclipse from menu Window → Preferences → General → Appearance, and I fail to change the font size. How can I do that? I use Eclipse v4.2 (Juno) on Windows 7.
-
possible duplicate of [How can I configure the font size for the tree item in the package explorer in eclipse](http://stackoverflow.com/questions/3124629/how-can-i-configure-the-font-size-for-the-tree-item-in-the-package-explorer-in-e) – bacar Feb 03 '14 at 16:37
-
1@mohammed: maybe it's time to revisit which one is the correct answer ;) – Diego V Oct 22 '16 at 13:43
13 Answers
On Juno and up you can adjust that font by CSS.
Lookup the files in eclipse\plugins\org.eclipse.platform_4.2.x.y\css
for your current style sheet (probably e4_default_win7.css
), and then just add the following rule:
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
font-size: 10px; /* <-- Desired font size */
}
Update: stylesheets are in eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css
folder since Eclipse 4.4 (Luna).

- 6,189
- 7
- 40
- 45
-
1See also [Jeeeyul's Eclipse Themes - Chrome](https://github.com/jeeeyul/eclipse-themes) for an easier way to edit the CSS, and [Themeable RWT Widgets](http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.rap.doc%2Fguide%2Freference%2Ftheming%2Findex.html) for some elements to style. Could not find a reference for ids to specific parts though. – Erlend Kristiansen Feb 13 '14 at 11:43
-
Unfortunately this only affects part of the folders and files. Some are still small. Running Eclipse 4.7.1 – lex82 Jan 21 '19 at 10:47
FYI:
From Eclipse v4.4 (Luna):
It looks like the CSS files are no longer in the old folder:
`eclipse/plugins/org.eclipse.platform_4.x.x.vy/css`,
They are moved to the new folder:
eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css
And you must select a theme to apply it, in the menu Windows → Preference → General → Appearance.

- 30,738
- 21
- 105
- 131

- 2,261
- 27
- 17
-
as stated [here](http://stackoverflow.com/a/16799846/2757620) if you want to change it on mac add ".MPart Tree{ font-size: 18;}" at the end of the file e4-dark_mac.css for the dark style, at at the end of file e4_default_mac.css for the regular style change. – qartal Apr 01 '16 at 00:19
This worked for me:
.MPart Tree{
font-size: 8;
}

- 1,292
- 16
- 22
-
1
-
I added this entry and it is the only solution of all suggested one I found that did actually work for me (Eclipse Mars @ OS X) – toobee Aug 10 '15 at 10:14
-
this worked for STS 3.6.3 which is Eclipse Luna SR1 (4.4.1), i changed plugins\org.eclipse.ui.themes_1.0.1.v20140819-1717\css\e4_default_win7.css on my win7 desktop. – user825402 Dec 07 '15 at 16:17
-
1It doesn't work for the whole tree for me. It makes some of the entries larger, but I am looking for a different class to make all of the tree nodes larger – Michael Draper May 09 '17 at 04:10
These are my settings and a screenshot of the IDE.
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree,
#org-eclipse-ui-views-ContentOutline Tree,
#PerspectiveSwitcher ToolBar {
font-size: 8px;
}
.MPartStack {
font-size: 8;
swt-simple: false;
swt-mru-visible: false;
}
You can lookup the CSS style files in eclipse/plugins/org.eclipse.platform_4.2.X.vY/css
edit your current style (probably e4_default_win7.css
).
Add something like this:
#org-eclipse-ui-jdt-PackageExplorer {
font-size: 20pt;
}
and hope you have a nice and large font (I did not check it myself).
Pro tip: Next time you need to find the CSS Id for a part of the UI, use CSS Spy which you can open with SHIFT-ALT-F5 (after you have installed it).
This worked for me using version 2019-09 on Windows 10:
- Locate the directory
C:\Users\johndoe\.p2\pool\plugins
in File Explorer, replacing "johndoe" with your own Windows user ID. - Depending on what you have done in the past with Eclipse, you should see one or more directories with names that start with
org.eclipse.ui.themes
. - Select the one with the most recent date modified. In my case its name was
org.eclipse.ui.themes_1.2.700.v20190826-0816
. - Within that directory open the directory named
css
. - Open the file named e4_default_win.css in a text editor, and append something similar to the following at the end of the file:
Tree { font-size: 24px; font: Mistral; }
- Don't pick those specific values! You should pick the font and font size you want. I deliberately made poor choices only to make the effect of those settings obvious in the screen shot below.
Save the file and restart Eclipse. You should see that the font has been changed in the Project Explorer and Package Explorer views, and a lot of other places as well:
Just be clear, the name of the file I edited was
C:\Users\johndoe\.p2\pool\plugins\org.eclipse.ui.themes_1.2.700.v20190826-0816\css\e4_default_win.css
. The name of the file you edit won't be exactly that, but it should be similar.

- 16,436
- 7
- 61
- 102
On Ubuntu 14.04 (Trusty Tahr) this was the best choice for me:
.MPart Tree{
font-size: 10;
}

- 30,738
- 21
- 105
- 131

- 465
- 3
- 7
-
I think it looks best in Ubuntu with `font-size:8px` and `font-family: Sans;` – Bevor Nov 04 '16 at 21:09
-
Yes, sure. In my case i wanted i little bit bigger but this was my personal preference. – harryssuperman Nov 05 '16 at 20:04
-
This works on windows too - just make sure you're editing the right theme file. – SDK Oct 03 '18 at 10:38
In my case I'm using DevStyle plugin with Spring Tool Suite 4.
The font size of project explorer can be changed going to Eclipse menu bar:
- Window
- Preferences
- DevStyle
- Extras
- Explorer font size
- Extras
- DevStyle
- Preferences
This setting is saved into workspace folder:
\workspace\.metadata\.plugins\com.genuitec.eclipse.ui.common.platform\extra-styling.css
I tried edit directly in file but when open Eclipse the file was overwritten
Using STS 4.8.0.RELEASE based on
Eclipse 2020-09
(requires aJDK11
)

- 4,983
- 4
- 38
- 58
Finally, from Eclipse 2020-09 (4.17) there is an option "Tree and Table font view" in Window -> Preferences -> General -> Appearance -> Colors and Fonts
which changes size of the font in Package Explorer, among others.

- 10,152
- 3
- 20
- 26
-
1This should be the accepted answer as of 2021, no need to alter css anymore. – oguz karakus May 10 '21 at 07:59
If it helps you to spot the setting easier , this is a screenshot how to change the font elsewhere than the font from the editor window

- 653
- 6
- 18
Eclipse is using native Windows widgets and their settings can only be changed from Display Properties / Settings / Advanced / General properties tab. There you can change your screen DPI to alter font sizes.

- 31,461
- 5
- 66
- 67
-
5
-
2Hey, you asked how and just gave you solution, don't blame me if you don't want to use it. :) – Eugene Kuleshov Jan 25 '13 at 21:03
-
3Actually, you can override those settings [by CSS](http://stackoverflow.com/a/15011440/1385678). – Diego V Feb 25 '13 at 13:18
Thanks to Veger's reply, I successfully changed the font of my PHP Explorer in PHP Perspective (with PDT installed). The following CSS code,
#org-eclipse-php-ui-explorer Tree {
font-family: Consolas;
font-size: 21px;
}
are added into my "eclipse-4.3\plugins\org.eclipse.platform_4.3.1.v20130911-1000\css\e4_default_win7.css" file.
You may choose a different CSS file, depending on the theme you choose through Preferences → General → Appearance: "Theme" drop-down list).
In Eclipse 4.7.x the CSS files are under eclipse/plugins/org.eclipse.ui.themes_1.2.1.v20170809-1435/css/
In my case I use the dark theme for OSX, so I opened the file e4-dark_mac.css and added the font-size line:
CTabFolder Tree, CTabFolder Canvas {
background-color: #2F2F2F;
color: #CCC;
font-size: 13pt; // new
}

- 83
- 2
- 10