Programs works on my pc, but not server
===

I have a program i've written and turned into a jar file. The jar file works just fine on my computer. When I try to run the program on the server it will be running on, the jar file doesn't work. I get this error. 

        Exception in thread "main" java.lang.NoClassDefFoundError: Publish
    Caused by: java.lang.ClassNotFoundException: Publish
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Could not find the main class: Publish. Program will exit.


I think this problem is caused by different versions of java or different environments or something. I think the libraries are not the problem here, but the environments where this program is being run. The jar file works perfectly on my own computer.

My java version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

Server java version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)


I also get this error, which suggests that I may have a 32 bit java while the server has a 64 bit and this might be causing problem.

Error occurred during initialization of VM
Could not reserve enough space for object heap

I got around this error easily by just allocating some memory to running this process.


Does anyone have any idea about how to fix this problem?

Note: i also looked at the manifest file and it seems fine