Running jars from cmd

I saw a lot of posts and found a lot of data on the net about this, but I'm still confused.

I downloaded the .jar file and I need to increase its heap size. I added jre1.6 / bin to the Windows path 64 bit and I start from cmd.

There is a problem: it cannot access the jar file.

Can someone explain in detail what I should do to run it from cmd. Do I need to add jar file location in Path too? I also noticed that in many posts they report a change in the class path, but I did not do anything as such.

Tell me if you need more information.

------------------------------- (Update)

This is really strange ..... I did what was mentioned here, and now the program loads and then exits with an Out of memory error stating that it needs more heap size, even if it worked before with a 128 m heap size . This happens when I increase it to 1024 m. Can someone explain the cause of the error. I have 3GB Ram, so I do not understand this .....

+4
source share
2 answers

The following should start the jar:

java -Xmx1024m -jar /path/to/the/jar.jar 

If you use a command from the directory in which the Jar is located, you can simply specify it by name. Otherwise, you need to determine the path to the Jar so that Java can find it.

+13
source

From the folder "C: \ Program Files \ Weka-3-6":

 java -Xmx1024m -jar weka.jar 
+2
source

All Articles