开发者

Running jar from cmd

I have seen a lot of posts and found lots of data on the net about this but I am still confused.

I have downloaded a .jar file and I need to increase its heap size. I have added the jre1.6/bin in the Path of Windows 64 bit and I run from cmd.

The problem arises that it says unable to access jar file.

Can anybody explain in some detail开发者_运维百科 what should I do to run it from cmd. Do i need to add the location of jar file into the Path too ?? Also I have noticed that in many posts they tell to change the classpath but I have'nt done anything as such.

Do tell if you need any extra information.

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

This is really wierd ..... I did it what was mentioned in here and now the program loads and then exits with Out of memory error saying that it needs more heap size even though it was working before with 128 m heap size. This happens when I increase it to 1024m. Can anybosy explain why the error could have come. I have 3GB Ram so I don't understand it.....


The following should run the jar:

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

If you are running the command from the directory that the Jar is in, you can just specify it by name. Otherwise you need to qualify the path to the Jar in order for Java to be able to find it.


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

java -Xmx1024m -jar weka.jar
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜