Index: trunk/docs/install/windows.rst
===================================================================
--- trunk/docs/install/windows.rst	(revision 770)
+++ trunk/docs/install/windows.rst	(revision 771)
@@ -24,5 +24,6 @@
    support activated. So, in case you want to use the Java support,
    simply rename the `zoo_loader_jave.cgi` file located in
-   `c:\\inetpub\\cgi-bin` to `zoo_loader.cgi`.
+   `c:\\inetpub\\cgi-bin` to `zoo_loader.cgi` and make sure the
+   `jvm.dll` can be found.
 
 
@@ -58,5 +59,5 @@
      appcmd.exe add vdirs /app.name:"Default Web Site/" /path:/cgi-bin /physicalPath:c:\inetpub\cgi-bin
      appcmd set config /section:handlers /+[name='CGI-exe1',path='*.cgi',verb='*',modules='CgiModule']
-
+     appcmd.exe set config /section:isapiCgiRestriction /+[path='c:\inetpub\cgi-bin\zoo_loader.cgi',description='ZOO-Project',allowed='True'] 
 
 
Index: trunk/docs/services/howtos.rst
===================================================================
--- trunk/docs/services/howtos.rst	(revision 770)
+++ trunk/docs/services/howtos.rst	(revision 771)
@@ -202,4 +202,19 @@
 sections to your ``main.cfg`` file:
 
+:[java]:
+   This section is used to pass -D* parameters to the JVM  created by the
+   ZOO-Kernel to handle your ZOO-Service (see `ref. 1
+   <http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html#BehavioralOptions>`__
+   or `ref. 2
+   <http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html#PerformanceTuning>`__
+   for sample available). 
+   For each map ``a = b`` available in the ``[java]`` section, the
+   option ``-Da=b`` will be passed to the JVM. 
+:[javax]:
+   The section is used to pass -X* options to the JVM (see
+   `ref. <http://docs.oracle.com/cd/E22289_01/html/821-1274/configuring-the-default-jvm-and-java-arguments.html>`__). For
+   each map ``a = b`` available in the ``[javax]`` section, the option
+   ``-Xab`` will be passed to the JVM (ie. set ``mx=2G`` to pass
+   ``-Xmx2G``).
 :[javaxx]:
    This section is used to pass -XX:* parameters to the JVM  created by the
@@ -213,10 +228,4 @@
    minus`` (respectively ``a=plus``) then the option ``-XX:-a``
    (respectivelly ``-XX:+a``) will be passed.
-:[javax]:
-   The section is used to pass -X* options to the JVM (see
-   `ref. <http://docs.oracle.com/cd/E22289_01/html/821-1274/configuring-the-default-jvm-and-java-arguments.html>`__). For
-   each map ``a = b`` available in the ``[javax]`` section, the option
-   ``-Xab`` will be passed to the JVM (ie. set ``mx=2G`` to pass
-   ``-Xmx2G``).
 
 ZOO-API
@@ -235,8 +244,28 @@
   cd zoo-api/java
   make
-  cp ZOO.class libZOO.so /usr/lib/cgi-bin
 
 .. Note:: running the previous commands will require that both
           ``javac`` and ``javah`` are in your PATH.
+
+You should copy the ``libZOO.so`` in a place Java can find it. In case you
+have defined the ``java.library.path`` key as ``/usr/lib/cgi-bin``
+(in the ``[java]`` section), then you should copy it there. 
+
+.. code-block:: guess
+
+  cp libZOO.so /usr/lib/cgi-bin
+
+The ZOO-API provides the following functions:
+
+:String translate(String s):
+   This function call the internal ZOO-Kernel function responsible for
+   searching a translation of ``s`` in the zoo-services dictionary.
+
+:void updateStatus(Hashmap conf,String pourcent,String message):
+   This function call the updateStatus ZOO-Kernel function responsible
+   for updating the status of the running service (only usefull when
+   the service has been called asynchronously).
+
+
 
 Java ZCFG requirements
Index: trunk/zoo-project/zoo-api/java/Makefile
===================================================================
--- trunk/zoo-project/zoo-api/java/Makefile	(revision 770)
+++ trunk/zoo-project/zoo-api/java/Makefile	(revision 771)
@@ -20,16 +20,16 @@
 all: libZOO.${ext}
 
-ZOO.class: ZOO.java
-	javac ZOO.java
+org/zoo_project/ZOO.class: org/zoo_project/ZOO.java
+	javac org/zoo_project/ZOO.java
 
-ZOO.h: ZOO.java ZOO.class
-	javah ZOO
+org_zoo_project_ZOO.h: org/zoo_project/ZOO.java org/zoo_project/ZOO.class
+	javah org.zoo_project.ZOO
 
-zoo-api.o: zoo-api.c ZOO.h
+zoo-api.o: zoo-api.c org_zoo_project_ZOO.h
 	gcc -fPIC -c zoo-api.c ${JAVACFLAGS} ${XML2CFLAGS} -I../../zoo-kernel/ -I../../../thirds/cgic206/
 
 libZOO.${ext}: zoo-api.o
-	gcc zoo-api.o -shared -o libZOO.${ext} -Wl,../../zoo-kernel/service_internal.o,${JAVA_FILES},${MS_FILES}${JS_FILES}../../zoo-kernel/ulinet.o ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lcrypto ${MS_LDFLAGS} ${MACOS_LD_FLAGS} -lcurl -lfcgi ${MACOS_LD_NET_FLAGS}
+	gcc zoo-api.o -shared -o libZOO.${ext} -Wl,../../zoo-kernel//service_yaml.o,../../zoo-kernel/lex.cr.o,../../zoo-kernel/main_conf_read.tab.o,../../zoo-kernel/lex.sr.o,../../zoo-kernel/service_conf.tab.o,../../zoo-kernel/service_internal.o,../../zoo-kernel/server_internal.o,../../zoo-kernel/response_print.o,${JAVA_FILES},${MS_FILES}${JS_FILES}../../zoo-kernel/ulinet.o ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lcrypto ${MS_LDFLAGS} ${MACOS_LD_FLAGS} -lcurl -lfcgi ${MACOS_LD_NET_FLAGS} -lzoo_service -lyaml
 
 clean:
-	rm -f *${ext} *o *.h *class
+	rm -f *${ext} *o *.h *class org/zoo_project/*.class
Index: trunk/zoo-project/zoo-api/java/ZOO.java
===================================================================
--- trunk/zoo-project/zoo-api/java/ZOO.java	(revision 770)
+++ 	(revision )
@@ -1,10 +1,0 @@
-import java.lang.*;
-import java.util.*;
-
-public class ZOO {
-    static { System.loadLibrary("ZOO"); }
-    public static Integer SERVICE_SUCCEEDED=3;
-    public static Integer SERVICE_FAILED=4;
-    public static native String _(String a);
-    public static native Integer updateStatus(HashMap conf,String pourcent,String message);
-}
Index: trunk/zoo-project/zoo-api/java/org/zoo_project/ZOO.java
===================================================================
--- trunk/zoo-project/zoo-api/java/org/zoo_project/ZOO.java	(revision 771)
+++ trunk/zoo-project/zoo-api/java/org/zoo_project/ZOO.java	(revision 771)
@@ -0,0 +1,12 @@
+package org.zoo_project;
+
+import java.lang.*;
+import java.util.*;
+
+public class ZOO {
+    static { System.loadLibrary("ZOO"); }
+    public static Integer SERVICE_SUCCEEDED=3;
+    public static Integer SERVICE_FAILED=4;
+    public static native String translate(String a);
+    public static native Integer updateStatus(HashMap conf,String pourcent,String message);
+}
Index: trunk/zoo-project/zoo-api/java/zoo-api.c
===================================================================
--- trunk/zoo-project/zoo-api/java/zoo-api.c	(revision 770)
+++ trunk/zoo-project/zoo-api/java/zoo-api.c	(revision 771)
@@ -1,8 +1,8 @@
-#include "ZOO.h"
+#include "org_zoo_project_ZOO.h"
 #include "service.h"
 #include "service_internal.h"
 #include "service_internal_java.h"
 
-JNIEXPORT jstring JNICALL Java_ZOO__1
+JNIEXPORT jstring JNICALL Java_org_zoo_1project_ZOO_translate
   (JNIEnv *env, jclass _class, jstring msg){
   const char *message = 
@@ -17,5 +17,5 @@
 }
 
-JNIEXPORT jobject JNICALL Java_ZOO_updateStatus
+JNIEXPORT jobject JNICALL Java_org_zoo_1project_ZOO_updateStatus
   (JNIEnv *env, jclass _class, jobject conf, jstring pourc, jstring msg){
 
Index: trunk/zoo-project/zoo-kernel/main_conf_read.l
===================================================================
--- trunk/zoo-project/zoo-kernel/main_conf_read.l	(revision 770)
+++ trunk/zoo-project/zoo-kernel/main_conf_read.l	(revision 771)
@@ -34,5 +34,5 @@
 %}
 
-attname	[a-zA-Z0-9_\-:]+
+attname	[a-zA-Z0-9_\-:.]+
 
 attvalue1	[%\*,;@a-zA-Z0-9_\-.:" "\"\'/\\\(\)\+\x41-\xff?&=]+
Index: trunk/zoo-project/zoo-kernel/service_internal_java.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_java.c	(revision 770)
+++ trunk/zoo-project/zoo-kernel/service_internal_java.c	(revision 771)
@@ -92,22 +92,26 @@
 #endif
 #ifndef WIN32
-  int nb=3+njdb;
-#endif
+  int nb=2+njdb;
+#endif
+  int nbs[3]={0,0,0};
+  maps* javaMap=getMaps(*main_conf,"java");
+  if(javaMap!=NULL){
+    nbs[0]+=count(javaMap->content);
+  }
+  int nbc1=0;
+  maps* javaXMap=getMaps(*main_conf,"javax");
+  if(javaXMap!=NULL){
+    nbs[1]+=count(javaXMap->content);
+  }
   int nbc0=0;
   maps* javaXXMap=getMaps(*main_conf,"javaxx");
   if(javaXXMap!=NULL){
-    nbc0+=count(javaXXMap->content);
-  }
-  int nbc1=0;
-  maps* javaXMap=getMaps(*main_conf,"javax");
-  if(javaXMap!=NULL){
-    nbc1+=count(javaXMap->content);
+    nbs[2]+=count(javaXXMap->content);
   }
 #ifdef WIN32
-  //#define nb (2+nbc0+nbc1)
-  const int nb=2+nbc0+nbc1;
+  const int nb=2+nbs[1]+nbs[2]+nbs[0];
   JavaVMOption *options=(JavaVMOption*)malloc(nb*sizeof(JavaVMOption));
 #else
-  JavaVMOption options[nb+nbc0+nbc1+1];
+  JavaVMOption options[nb+nbs[1]+nbs[2]+nbs[0]+1];
 #endif
   JavaVMInitArgs vm_args;
@@ -123,24 +127,13 @@
 #endif
   int i,start;
-  map *cursorxx=NULL;
-  if(javaXXMap!=NULL)
-    cursorxx=javaXXMap->content;
-  map *cursorx=NULL;
-  if(javaXMap!=NULL)
-    cursorx=javaXMap->content;
   options[0].optionString = oclasspath;
   options[0].extraInfo=NULL;
   options[1].optionString = "-server";
   options[1].extraInfo=NULL;
-  char tmp1[100];
-  sprintf(tmp1,"-Djava.library.path=%s",cwdMap->value);
-  fprintf(stderr,"%s\n",tmp1);
-  options[2].optionString = tmp1;
+#ifdef USE_JDB
+  options[2].optionString = "-Xdebug";
   options[2].extraInfo=NULL;
-#ifdef USE_JDB
-  options[3].optionString = "-Xdebug";
+  options[3].optionString = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7896";
   options[3].extraInfo=NULL;
-  options[4].optionString = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7896";
-  options[4].extraInfo=NULL;
 #endif
 #ifdef WIN32
@@ -148,19 +141,33 @@
   options[1].optionString = "-Xmx512m";
 #else
-  start=3+njdb;
-#endif
-  for(i=0;i<nbc0;i++){
-    char *tmp=parseJVMXXOption(cursorxx);
+  start=2+njdb;
+#endif
+  map *cursors[3]={NULL,NULL,NULL};
+  if(javaMap!=NULL)
+    cursors[0]=javaMap->content;
+  if(javaXMap!=NULL)
+    cursors[1]=javaXMap->content;
+  if(javaXXMap!=NULL)
+    cursors[2]=javaXXMap->content;
+  for(i=0;i<nbs[0];i++){
+    char *tmp=parseJVMOption(cursors[0]);
     options[start+i].optionString = zStrdup(tmp);
     options[start+i].extraInfo=NULL;
     free(tmp);
-    cursorxx=cursorxx->next;
-  }
-  for(;i<nbc1+nbc0;i++){
-    char *tmp=parseJVMXOption(cursorx);
+    cursors[0]=cursors[0]->next;
+  }
+  for(;i<nbs[0]+nbs[1];i++){
+    char *tmp=parseJVMXOption(cursors[1]);
     options[start+i].optionString = zStrdup(tmp);
     options[start+i].extraInfo=NULL;
     free(tmp);
-    cursorx=cursorx->next;
+    cursors[1]=cursors[1]->next;
+  }
+  for(;i<nbs[0]+nbs[2]+nbs[1];i++){
+    char *tmp=parseJVMXXOption(cursors[2]);
+    options[start+i].optionString = zStrdup(tmp);
+    options[start+i].extraInfo=NULL;
+    free(tmp);
+    cursors[2]=cursors[2]->next;
   }
 
@@ -168,5 +175,5 @@
   vm_args.version = JNI_VERSION_1_6;
   vm_args.options = options;
-  vm_args.nOptions = start+nbc0+nbc1;
+  vm_args.nOptions = start+nbs[0]+nbs[1]+nbs[2];
   vm_args.ignoreUnrecognized = JNI_TRUE;
 
@@ -209,5 +216,5 @@
   if (cls != NULL) {
 #ifdef JAVA7
-    (*env).ExceptionClear();
+@    (*env).ExceptionClear();
     pmid=(*env).GetStaticMethodID(cls, s->name, "(Ljava/util/HashMap;Ljava/util/HashMap;Ljava/util/HashMap;)I");
 #else
@@ -281,5 +288,5 @@
   (*jvm)->DestroyJavaVM(jvm);
 #endif
-  for(i=0;i<nbc1+nbc0;i++){
+  for(i=0;i<nbs[2]+nbs[1]+nbs[0];i++){
     free(options[start+i].optionString);
   }
@@ -334,4 +341,17 @@
 
 /**
+ * Create a string containing the JVM -D* options for a given map
+ * The result will be : -Dname=value
+ *
+ * @param m the map containing the option
+ * @return a char* containing the valide JVM option (-D*)
+ */
+char *parseJVMOption(map* m){
+  char *res=(char*)malloc((strlen(m->name)+strlen(m->value)+4)*sizeof(char));
+  sprintf(res,"-D%s=%s",m->name,m->value);
+  return res;
+}
+
+/**
  * Create a string containing the JVM -XX:* option for a given map
  * Depending on the map' name:
@@ -458,5 +478,5 @@
 	    
 	    for(i=0;i<alen1;i++){
-	      map* vMap=getMapArray(tmp->content,"value",i);	    
+	      map* vMap=getMapArray(tmp->content,"value",i);
 	      map* sMap=getMapArray(tmp->content,"size",i);
 	      map* mMap=getMapArray(tmp->content,tmap->value,i);
Index: trunk/zoo-project/zoo-kernel/service_internal_java.h
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_java.h	(revision 770)
+++ trunk/zoo-project/zoo-kernel/service_internal_java.h	(revision 771)
@@ -45,4 +45,6 @@
   char *parseJVMXOption(map*);
 
+  char *parseJVMOption(map*);
+
   int zoo_java_support(maps**,map*,service*,maps**,maps**);
 
Index: trunk/zoo-project/zoo-services/hello-java/HelloJava.java
===================================================================
--- trunk/zoo-project/zoo-services/hello-java/HelloJava.java	(revision 770)
+++ trunk/zoo-project/zoo-services/hello-java/HelloJava.java	(revision 771)
@@ -25,4 +25,5 @@
 import java.lang.*;
 import java.util.*;
+import org.zoo_project.*;
 
 public class HelloJava {
@@ -31,5 +32,5 @@
         String v=tmp.get("value").toString();
         HashMap hm1 = (HashMap)(outputs.get("Result"));
-        hm1.put("value",ZOO._("Hello "+v+" from JAVA World !!"));
+        hm1.put("value",ZOO.translate("Hello "+v+" from JAVA World !!"));
         return ZOO.SERVICE_SUCCEEDED;
     }
@@ -47,5 +48,5 @@
 	}
         HashMap hm1 = (HashMap)(outputs.get("Result"));
-        hm1.put("value",ZOO._("Hello "+v+" from JAVA World !!"));
+        hm1.put("value",ZOO.translate("Hello "+v+" from JAVA World !!"));
         return ZOO.SERVICE_SUCCEEDED;
     }
