Wednesday, May 2, 2012

Set encoding as UTF 8 in eclipse

Eclipse :-

For windows :-

1. Open Run Dialog > "your application" > Common Tab > Console Encoding > Other "set it to UTF-8"

2. Open Run Dialog > "your application" > Arguments Tab > VM Arguments > Add "-Dfile.encoding=UTF-8"

and of course Window Menu > General > Workspace > Text file encoding should be set to "UTF-8"

then you can run your application ( doesn't matter Standalone or inside Tomcat)

Mac Os :-

added -Dfile.encoding=UTF-8 to /Applications/eclipse/

Eclipse Indigo :-

simply by going to Edit > Set Encoding, then choosing UTF-8.

e.g. this code will work:

public class Hello {

public static void main(String [] args)
System.out.println("english letters. русские буквы");
System.out.println("new Date()= " + new Date());

Create MongoDB service in Windows OS

1) Open Command Prompt 2) Create directory for Database and Logs                    mkdir c:\data\db                     mkdir c:\...