Running 0.9 in IntelliJ IDE

In order to run an SGS application the following must be true:

You must have the 0.9 SGS SDK downloaded on your machine
You must be running at least JDK version 1.5.0_11

To create an SGS application project do the following:

(1) Create a Java Project
(2) Include as project libraries all the jars in the SGS sdk lib directory except sgs-client.jar
(3) Include as a project library the db.jar in the sdk lib/db directory
(4) Ensure the appropriate sub directory of lib/db for your OS is in your PATH.
(5) Create an application config .properties file (eg foo.properties). You can look at HelloWorld.properties in the tutorial for an example. Paths can be relative. If so, make sure they are relative to your working directory for the project.
(6) Create a run configuration with the following information:

Edit a Run Configuration
Set your main to com.sun.sgs.impl.kernel.Kernel
Add the following to your VM parameters:
-Djava.util.logging.config.file=/sgs-logging.properties
-Dcom.sun.sgs.config.file=/sgs-config.properties
Add your application config file as the sole parameters to the application

Edit: Pls be aware that in the 0.9 version you need to manually create a directory named “dsdb” in your application root. (The application root is set in the application config properties file) If you don’t the database will exception on start-up. This is a known annoyance that is on our list to rectify.

Its almost exactly like running it in Eclipse. There are some gotchs based on your OS. The Windows version of the libdb requires several MS Visual C libraries to be present on your machine. You can get them from the Microsoft Update site as the .NET Framework 2.0…

Thanks I’m gonna sticky this!