You are not logged in.
I opened a thread recently about replacing the ugly swing buttons in Java applications. After successfully modifying my ~/.bashrc, all was well. However, these new changes were only present when run from a terminal. I assumed it was because my desktop was still running a bash session that hadn't loaded the new options yet, so I restarted.
Symptom: Java apps launched from the GUI still have old swing buttons, but have the GTK look and feel when launched from a terminal.
My .bashrc additions:
# Java stuff
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"I use SLiM for a graphical login experience. Could this be affecting it? I'm not sure what happens differently behind the scenes when using a login manager other than that CTRL+ALT+F7 brings me to my GUI when I use one (because all 6 TTYs are still TTYs).
Last edited by 2mac (2014-01-02 20:51:35)
Offline
Just a guess: Try putting the "export" command in the middle of your "~/.xinitrc" file, which is used by SLiM when loading your X session.
Offline
I put
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"&at the top of my ~/.xinitrc, and it had no effect. The "&" is necessary, correct? I was told that all commands before the "exec" line should end in an ampersand.
Last edited by 2mac (2014-01-02 19:15:34)
Offline
No, the ampersand is not necessary, because that command finishes instantly. Even so, it shouldn't make a difference.
I'm sorry, I'm not sure how to fix that Java issue. ![]()
EDIT: The ampersand was apparently the problem! See below. ![]()
Last edited by drcouzelis (2014-01-02 21:10:26)
Offline
I had a similar issue where .xinitrc wasn't working to set an environment variable. I put mine in ~/.config/openbox/environment and it worked. If you run openbox try that. If using a different window manager maybe try /etc/environment I am unsure of how slim functions though maybe there are config files for it. I think slim is on it's way out though (already lacks some compatibility with systemd; they may fix it though upstream I have no idea). But yeah try the environment file way and see if that does it (assuming you have tested your command from the shell and it works how you want).
Offline
Try it from .xinitrc without the ampersand. By appending &, you export the variable only in a background process/subshell, so it does make a difference (I checked this in both bash and zsh).
Also remove the export from .bashrc, so you can easily test whether the export from xinitrc is successful by echoing the variables in a terminal emulator running in your X session.
Offline
Removing the ampersand did successfully resolve the issue.
Thanks for your help.
Offline
FWIW (and I am open to being corrected if this is wrong) I put those commands in /etc/profile. I did that because I wanted all system users to have this functionality.
Matt
"It is very difficult to educate the educated."
Offline
Can you show me an example of how Java apps look like on your machines?
I added the settings discussed here but still Crashplan backup software, which is a Java applications, does not respect my icon theme. Yet I am not sure whether the icons used there are the Swing icons discussed here.
Offline
Here is NetBeans on my machine:
Matt
"It is very difficult to educate the educated."
Offline
Hmmm. I'll have to check. Are you sure that the app isn't defining it's own icons? I mean, when I write Java apps I usually define my own icon for things -- the user doesn't have the option to modify them without taking apart the code.
I will try to do more digging this evening. Is the app you're using the same as I would get by installed CrashPlan from the AUR? If so, I may try installing it and see if my icons are different from yours.
Matt
"It is very difficult to educate the educated."
Offline
@mrunion
That makes sense. I did not know that the programmer can define custom icons in his Java application.
But thanks for checking Crashplan. Indeed installing the package from AUR will give you exactly the same version.
Cheers!
Offline
I had time for a quick glance it it does appear that it uses its own icon resources.
Matt
"It is very difficult to educate the educated."
Offline