Category Archives: Linux

Install & Uninstall Java

Install Java

NOTE: if you want to develop to Android then:

  1. install an 64bit version
  2. install Oracle Java as shown below

You can use 32bit but it does not worth it.

OpenJava

If you want the default (OpenJava) then:

  1. sudo apt-get update
  2. sudo apt-get install default-jre
  3. sudo apt-get install default-jdk

Oracle Java

But preferably if you are going to develop in Java, install Sun version instead:

  1. sudo apt-get install python-software-properties
  2. sudo add-apt-repository ppa:webupd8team/java
  3. sudo apt-get update
  4. sudo apt-get install oracle-java7-installer            (or 8 etc)
  5. sudo update-alternatives –config java (to select default Java)

If you want to setup JAVA_HOME:

  1. sudo update-alternatives –config java
  2. From the menu above, write down the path of the version you want (eg /usr/lib/jvm/java-7-oracle)
  3. edit /etc/environment (vim, nano etc)
  4. add or update the line: JAVA_HOME=”YOUR_PATH”
  5. reload environment: source environment

Uninstall Java

If you want to completely uninstall java then:

  1. Remove packages:
dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove
  1. Purge config files:
dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge
  1. Remove Java config and cache directory:
sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf
  1. Remove manually installed JVMs:
sudo rm -rf /usr/lib/jvm/*
  1. Remove Java entries, if there is still any, from the alternatives:
for g in ControlPanel java java_vm javaws jcontrol jexec keytool mozilla-javaplugin.so orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200 appletviewer apt extcheck HtmlConverter idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic schemagen serialver wsgen wsimport xjc xulrunner-1.9-javaplugin.so; do sudo update-alternatives --remove-all $g;
  1. Search for possible remaining Java directories:
sudo updatedb
sudo locate -b '\pack200'

And look for entries with jre or jdk and delete them

At the sidebar menu you can find links to scripts that do all those steps at once.

 

 

references:

https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get

http://askubuntu.com/questions/84483/how-to-completely-uninstall-java

Deamazon Ubuntu

 

  1. At Ubuntu settings
    1. at → Privacy
      1. Clear “Include online results” checkbox
  2. At command prompt:
    1. sudo apt-get remove unity-lens-shopping
    2. sudo apt-get remove unity-scope-video-remote
    3. sudo apt-get remove unity-scope-musicstores
    4. sudo apt-get remove unity-webapps-service
  3. At dconf-editor:
    1. At com → canonical → unity → webapps
      1. remove everything under : allowed-domains
      2. remove everything under : dontask-domains
      3. remove everything under : preauthorized-domains

 


References:

http://askubuntu.com/questions/192269/how-can-i-remove-amazo…

http://askubuntu.com/questions/214755/how-to-remove-unity-we…

http://xchamitha.blogspot.com/2012/11/de-amazonising-ubuntu-…


repost from:

https://news.ycombinator.com/item?id=4888234

Launcher

The following settings disable default launcher of Unity

Install compiz plugins:

sudo apt-get install compizconfig-settings-manager
sudo apt-get install compiz-plugins

Open compizconfig-settings-manager

Click switcher:

  1. disable alt tab key binding
  2. disable shit alt tab key binding

Click Window management:

  1. Enable “Static Application Switcher”
  2. resolve conflicts
  3. set all anyway
  4. Click switcher
    1. set alt-tab to next window (all windows)
    2. set shift-alt-tab to previous window (all windows)

Nautilus

The following settings enable list view, enable executing sh files by clicking on them and enable viewing MIME types on the list view.

Beware that execution of sh files via double click is risky.

At Edit → Preferences:

  1. at →Views
    1. Change Default view to List view
  2. at → Behavior
    1. Change “Ask each time” to Executable Text files settings
  3. at → List columns
    1. add MIME type and permissions. Move MIME type to top
    2. add permissions if you like

Unity tweak tools

The following settings are my personal favorites.

The settings are not risky.

Generally transparency is disabled, menu bar (launcher) is placed at the bottom of the screen and mouse features are disabled (like snapping, hot corners etc) since i dont use the mouse.

sudo apt-get install unity-tweak-tool

Do the following configurations:

  1. at Unity->Launcher menu:
    1. disable autohide
    2. disable transparency
    3. disable “Show Desktop Icon”
    4. set position to “bottom”
  2. at Unity->Search:
    1. disable blur
    2. disable “show more suggestions”
  3. at Unity->Panel:
    1. disable transparency
    2. select “Show my name”
  4. at Unity->Switcher:
    1. clear “Display Show Desktop icon”
  5. at Unity->Web Apps:
    1. clear all “Preauthorized domains”
  6. at Window Manager->General:
    1. disable zoom
    2. disable window animations
    3. set d as Show desktop shortcut
  7. at Window Manager->Window snapping:
    1. disable window snapping
  8. at Window Manager->Hotcorners:
    1. disable hotcorners
  9. at Appearance->Cursor:
    1. Set cursor to Dmz-black
  10. at System->Scrolling:
    1. Disable overlay