Java and JVM on Facebook Accelerators
Introduction
This page is a guide to creating and deploying applications on your Facebook Accelerator developed in the Java programming language, and developed in other languages that run on top of the Java Virtual Machine (JVM).
If you're new to Java, the JVM, or want a general introduction to developing and deploying Java applications, start off by reading the Java Overview in the All Accelerators Knowledge Base.
Version
Java is installed version “1.6.0_01”.
You will need to install Geronimo or another J2EE application to serve your application.
Libraries
The Java client libraries that are provided in the standard java include directory are the official facebook Java libraries and include the standard core components:
- src directory with FacebookRestClient.java, FacebookJsonRestClient.java, FacebookXmlRestClient.java, FacebookException.java and FacebookMethod.java
- ExampleClient application
- Classes to verify fb_sig request
- bin directory with .jar files needed for compilation and a facebook.jar
The Java documentation is at http://wiki.developers.facebook.com/index.php/Java
Warning on Java memory usage in Accelerators
Java automatically sets a heap size when it starts. The default calculation can give undesirable results in Joyent Accelerators (e.g. consuming half the memory in a container for a simple application).
See this thread for further discussion.
To avoid problems, specify heap size parameters when you launch java:
# java -Xms16m -Xmx64m MyJavaApp