Category Archives: Linux

Can not type asterisk in Eclipse

Is not able to type asterisk * in Eclipse, but it works pretty nice in other applications. To resolve:

Solution 1

  • open terminal and go current workspace folder
  • Go to .metadata/.plugins folder and locate workbench.xml file with bad lines in it:
    grep -R "SHIFT+8" *
    The result will look like:

    org.eclipse.e4.workbench/workbench.xmi: <bindings xmi:id="_aLHQwCaAEeOBOe4lOFe2qQ" keySequence="SHIFT+8 W" command="_eZ-6uoZrEeKW-cnY0IziBw">
    org.eclipse.e4.workbench/workbench.xmi: <bindings xmi:id="_aLH30CaAEeOBOe4lOFe2qQ" keySequence="SHIFT+8 I" command="_eZucD4ZrEeKW-cnY0IziBw">
  • Open workbench.xmi with your favorite text editor and remove these two lines

Solution 2

In Eclipse go to Window – Preferences – Editors – Keys. Search commands with Shift+8 keys, select them, press Unbind Command button.

 

Eclipse: install new software does not work

I try to install additional plugins in Eclipse Kepler SR2 from Help -> Install New Software menu. I select a site or type filter text,  but nothing happened, the selection window remains blank. Internet works fine on my machine as well as Help -> Eclipse Market Place menu.

Solution: close eclipse, go to eclipse workspace folder and remove the following file:
.metadata/.plugins/org.eclipse.equinox.p2.ui/dialog_settings.xml

Install PostgreSQL on Ubuntu

Today I installed one more PostgreSql on one more Ubuntu. That’s why I decided to memorize my steps here for quick reference.

Install postgresql and related packages

Type in terminal:
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install pgadmin3

Setting password for postgres user

To set password for postgres user, open psql command prompt:
sudo -u postgres psql postgres
Type command
\password postgres
type password twice when prompted and please don’t forget it 🙂
press ctrl-D to exit

Continue reading

Install Hadoop on Ubuntu

The best article of Hadoop installation I found is http://codesfusion.blogspot.ru/2013/10/setup-hadoop-2x-220-on-ubuntu.html 

I adopted it a little for my configuration: Ubuntu 14.04, Hadoop 2.2.0 single node, JDK 6. Not latest versions of Java and Hadoop but I had to reproduce existing production system.  

My steps are:

Install prerequisites

JDK 6 and ssh:

$ sudo apt-get install oracle-java6-installer
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo  apt-get update
$ sudo apt-get install oracle-java6-installer
$ sudo apt-get install ssh

Continue reading

Eclipse menu does not appear in Ubuntu 14.04

Tested with Ubuntu 14.04, Eclipse Kepler SR2

Eclipse itself works fine but menus File, Edit etc. does not open and cut off.

To fix this, open eclipse.desktop file for edit. It's located at

~/.local/share/applications/eclipse.desktop

or at /usr/share/applications/eclipse.desktop

Find the line Exec=… and replace the whole line with

Exec = env UBUNTU_MENUPROXY = /opt/eclipse/eclipse

replace /opt/eclipse/eclipse with a path to your Eclipse.

Install Oracle JDK 7 on Ubuntu 13.10

Install JDK from repository (oracle-java7-installer from this ppa is JDK)
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Set this version to be used by default
sudo update-java-alternatives -s java-7-oracle
Set up environment variables
sudo apt-get install oracle-java7-set-default

Glassfish 4 and Postgresql 9.3 driver

Today I configured another development stend for our team. This time I added Postgresql 9.3 ODBC driver support to our Glassfish 4 server. What should I do to repeat this actions:

Put Postgresql driver to Glassfish domain lib folder

This link contains the latest PostgreSql driver: http://jdbc.postgresql.org/download.html  I got the postgresql-9.3-1100.jdbc41 one. 
Copy downloaded driver to GLASSFISH_HOME/domains/YOUR_DOMAIN/lib, for example to /opt/glassfish4/domains/domain1/lib
Restart Glassfish

Continue reading

How to install JBoss AS on Ubuntu

Today I installed JBoss AS 7.1 on our Ubuntu 13.04 stend. I'm sure it is not the last time when I prepare JBoss application server, so I decided to memorize my steps in this post.

The installation procedure is:

Install JDK 7

Install JDK from repository (oracle-java7-installer from this ppa is JDK)
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Set this version to be used by default
sudo update-java-alternatives -s java-7-oracle
Set up environment variables
sudo apt-get install oracle-java7-set-default

Continue reading

JBoss AS 7.1 and UTF-8 encoding

Today I faced an interesting problem at work. It was JSP + Spring MVC 4 + Apache Tiles 2 + JBoss AS 7.1 application. JSP pages contain UTF-8 encoded Russian text encoding and should be displayed in UTF-8 in browser. I placed  @Page directive in some pages:

<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

Pages with above directive started to display non-English text perfectly fine. Others continued to show me unreadable rubbish instead (in default JBoss ISO-8859-1). So I already had a solution:

Solution 1 – modify every JSP page in the project to add proper @page directive.

Continue reading