Difference between revisions of "Set all Java apps to use GTK+ font & theme settings"

→‎How do you do it?: Changed _JAVA_OPTIONS definition as proposed by Tids
imported>Photon
imported>Photon
(→‎How do you do it?: Changed _JAVA_OPTIONS definition as proposed by Tids)
Line 16: Line 16:
1) Set the variable '''_JAVA_OPTIONS''' accordingly:
1) Set the variable '''_JAVA_OPTIONS''' accordingly:


  export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
  export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel ${_JAVA_OPTIONS}"


2) Run your Java app from the same terminal window.
2) Run your Java app from the same terminal window.
Line 22: Line 22:
If the result looks good to you, let us make the changes permanent:
If the result looks good to you, let us make the changes permanent:


1) Append the above definition of the '''_JAVA_OPTIONS''' variable to '''~/.profile''' (for your user only) or '''/etc/profile''' (system-wide). If the file does not exist, create it.
1) Append the above definition of the '''_JAVA_OPTIONS''' variable to '''~/.profile''' (for your user only) or '''/etc/profile.d/90-java_ops.sh''' (system-wide). If the file does not exist, create it.


2) Restart the system
2) Restart the system
Line 30: Line 30:
4) If, for some reason, the entry in '''~/.profile''' or '''/etc/profile''' had no effect, you can put the following line into '''/etc/environment''':
4) If, for some reason, the entry in '''~/.profile''' or '''/etc/profile''' had no effect, you can put the following line into '''/etc/environment''':


  _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
  _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel ${_JAVA_OPTIONS}"


<br clear="all"/>
<br clear="all"/>
Anonymous user