Access restriction: The type BASE64Encoder is not accessible due to restriction

Problem Downloaded a Java sample from Alexa API on Amazon service, imports it into Eclipse, but unable to compile and hits following “Access restriction” errors : Access restriction: The type BASE64Encoder is not accessible due to restriction on required library /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar P.S Using JDK 1.6 and Eclipse IDE 4.2 import sun.misc.BASE64Encoder; // Access restriction error …

Read more

How to get Alexa Ranking In Java

In this example, we show you how to use Java and DOM XML parser to get the Alexa ranking from below the undocumented API : http://data.alexa.com/data?cli=10&url=domainName 1. Alexa API For example, type following URL in your browser : http://data.alexa.com/data?cli=10&url=mkyong.com Alexa will return back following XML result : <ALEXA VER="0.9" URL="mkyong.com/" HOME="0" AID="="> <DMOZ> <SITE BASE="mkyong.com/" …

Read more

How to get Google PageRank (PR) in Java

In this example, we will show you how to get Google PageRank (PR) in Java. To request a PageRank for “mkyong.com”, you just need to send following HTTP request : http://toolbarqueries.google.com/tbr?client=navclient-auto&hl=en&ch=6236440745 &ie=UTF-8&oe=UTF-8&features=Rank&q=info:mkyong.com P.S Above URL is used by Google toolbar plugin. The tricky part is following hashing value : ch=6236440745 Google is using Bob Jenkins …

Read more