Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Making Eclipse look more beautiful on Linux

  • 0
You may have noticed that Eclipse, other than on the windows OS, looks kind of clumpsy on Linux. This is because the fonts are too heavy and big, at least for my taste.

Changing the font size via Window --> Preferences only affects the Editor font sizes. But that's not enough. So here's a workaround to change the font size of all the menus, dialogs, etc. in Eclipse on Linux.

In your home directory create a file named: ~/.gtkrc-eclipse with the following content:

 style "eclipse" {  
     font_name = "Sans Condensed 8"  
 }  
 class "GtkWidget" style "eclipse"  

Now you can start Eclipse with a this command:

 GTK2_RC_FILES=/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:/home/user/.gtkrc-eclipse '<path to your eclipse bin>'  

Or if you want to create an Launcher icon use this command:

 env GTK2_RC_FILES=/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:/home/user/.gtkrc-eclipse '<path to your eclipse bin>'  

Now you should see way smaller fonts in the menus and dialogs of Eclipse.
But what's with the Tabs? They have still too large fonts. In order to change the font size of tabs, we have to tweak a little more:

In your eclipse installation directory go to:
 /plugins/org.eclipse.platform_*/css  

and open e4_default_gtk.css with your text editor.
Here you can see a section similar to this:

 .MPartStack {  
      font-size: 9;  
      swt-simple: false;  
      swt-mru-visible: false;  
 }  

Simply change the font size or erase this line.
Restart eclipse and obtain the results.

--
This workaround was tested on Xubuntu 13.10 and LMDE Cinnamon with Eclipse Kepler.

Installing Oracle JDK on Debian based Linux distributions

  • 0
This guide is for those who would like to use the official JDK from Oracle on a debian based linux distribution (like Crunchbang). While the installation procedure for OpenJDK is very simple, installing the Oracle JDK requires some work, since it cannot be installed via the software repositories.

I'll describe two ways to install the JDK.

 Manually download and install the jdk from oracle

1) Download the jdk<version>.tar.gz from Oracle.
2) Navigate to the downloaded file and extract it: tar -xf jdk-7u4-linux-i586.tar.gz
3) Decide where to install the new JDK. I prefer to install the new JDK in /usr/lib/jvm
4) Now move the extracted JDK folder to that location.
5) We have to refer to the newly installed JDK and the Firefox Java Plugin (in order the use java applets):

 
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk<version>/bin/java" 1
sudo update-alternatives --config java
sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk<version>/jre/lib/i386/libnpjp2.so" 1
sudo update-alternatives --config mozilla-javaplugin.so


6) Test your java installation by typing into a terminal:
java -version

7) Finally you have to set the JAVA_HOME variable by adding the following two lines to the file .bashrc
 
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_04/
export JAVA_HOME

Done!

This approach, however, has a little problem. Whenever you decide to update your current JDK you have to reconfigure the system to use the updated version of your JDK.

Solution: Just make a symlink /usr/lib/jvm/jdk which points to /usr/lib/jvm/jdk<version>.
update-alternatives schould refer to this symlink. After you've updated your JDK all you have to do is to update the symlink to the new installed JDK location/name. 


 Manually add the ppa repositories to te software sources

This is the second approach to install the Oracle JDK. With this approach you can stay up to date to the latest Oracle Java Version. Just run the following commands as root:
 
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a     /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java7-installer
exit

Source: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html


Greets!

unusable dark menu bar in netbeans 7.1.2 running on ubuntu 12.04

  • 1
If you installed Netbeans IDE on the current Ubuntu Version 12.04 LTS and you cannot find the menubar, this is because it has a dark theme with dark fonts.
This is how to fix it:

locate the "netbeans.conf" file. Usually this file can be found under "<netbeans-location>/etc" .
In this file there should be a line starting with "netbeans_default_options".
Add the following argument to it: --laf Metal


Finally restart the netbeans IDE.