Problem of Google username/password Authentication in Java

When I was trying to connect Blogger service in my Java application, I got the following exception:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps
at Main.main(
Caused by: java.lang.ClassNotFoundException:
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
... 4 more

The following is my code. I was curious about what value "exampleCo-exampleApp-1" should be and spend a lot of time on finding the correct value.

	public static void main(String[] args) throws ServiceException, IOException {
		// TODO Auto-generated method stub
		GoogleService myService = new GoogleService("blogger", "exampleCo-exampleApp-1");
		myService.setUserCredentials("[email protected]", "mypassword");

Actually, "exampleCo-exampleApp-1" can be anything, and it does not cause the problem. The problem is a missing .jar file called.

The two jar files required is:

They are located in the client library which can be downloaded from:

The problem is solved and now you can retrieve all blogs under your Google account, create a blog post, etc. by following examples in Google developer's guide.

Category >> Google API  
If you want someone to read your code, please put the code inside <pre><code> and </code></pre> tags. For example:
String foo = "bar";