0

Not sure exactly what I'm doing wrong.

This is my local file structure: enter image description here

If i run the following command from the command line in windows in the above directory: java -jar server.jar -l SAD1.lvl -g 50 -c "java -Xmx2048m sc.SearchClient". Then the program executes completely as it should i.e. a GUI displays and then some computations etc.

My problem is that I want to move this to eclipse instead, so I can simply build and run my program after code edits instead of running it from the command line. This is how my file structure looks in eclipse:

enter image description here

As you can see I have added the jar to the project build path. Additionally, after right clicking Assignment 1 -> Run As.. -> Run Configurations -> Arguments I have added the following arguments to the field "Program Arguments":

enter image description here

Yet when I run the program from eclipse I get some parts of the program (early lines in the Main method) to print some text to the console but the main GUI that shows up when I run it from the command line does not show. Also any additional text output that I get in the command line does not show either.

I'm clearly missing something here. Any help would be appreciated.

Force444
  • 3,321
  • 9
  • 39
  • 77
  • 1
    I haven't been using eclipse for a long time, but from what I see, I'd say Program arguments are what they say, meaning that you should remove the `java -jar server.jar` part (assuming arguments after are used by your program and not the JVM). – Marko Gresak Feb 08 '15 at 19:27
  • I'm using the -Xmx option to specify some memory limits, so maybe that should go in the VM part actually. I'll just try and remove the part you suggested and possibly move the -Xmx part to the VM arguments. – Force444 Feb 08 '15 at 19:30
  • No luck doing that. But I think you might be right in that the arguments are not specified correctly. Not sure how to get it working though – Force444 Feb 08 '15 at 19:33
  • [Does this help?](http://stackoverflow.com/a/11300970/1276128) – Marko Gresak Feb 08 '15 at 19:43
  • Not really no :/ Even if I leave out the jvm memory options it should still work, which it doesn't.. – Force444 Feb 08 '15 at 19:53
  • The option "-c" and its argument is meant to be processed by your application? Should it start another Java program? – laune Feb 08 '15 at 19:58
  • @laune Yes it should start to another program called SearchClient.java where there is a main method. – Force444 Feb 08 '15 at 20:00

0 Answers0