• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to wrap java programs in cmd.exe and bash?  RSS feed

 
Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a groovy program that needs to know the number of args:



Here is the bat file I use to call it and it is not working.


Here is the bash file I use to call it and it is not working.


The problem is that args.size() always returns the same value regardless of how many arguments I pass to main. The solution is to manually set up the class path each time and abandon the bat and bash scripts.

Is there a way to write my bash and bat files so they are sensitive to the number of arguments? I am posting this here in the java forum because I don't believe this problem is specific to groovy.

Thanks,
Siegfried
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know, but this is too difficult for "beginning", so I shall move this thread.
 
Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow! No reply in a while. Does this mean it is not possible? I'm going to try cross posting in www.unix.com concerning bash. I'm not sure where to solicit help with cmd.exe.
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.cmd file:$* may work in Unix but I'm not really sure.
 
Siegfried Heintze
Ranch Hand
Posts: 417
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for sharing that!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!