wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes command line params and executable jars Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "command line params and executable jars" Watch "command line params and executable jars" New topic
Author

command line params and executable jars

Jeremy Anderson
Greenhorn

Joined: Mar 28, 2002
Posts: 2
In my project, I decided to use -D params on the command line to pass the hostname, port and database file. I mainly did this because I felt it provides for more readable startup scripts and seems to be the way BEA and other major vendors pass startup parameters. I'm a little worried that the graders will not like this style as much. Has anyone else used the -D param style instead of passing ordered command line parameters?
Also, I've read that some people have been creating executable jar files for the client and server. Does this seem to gain more points? If so, how do you specify the policy file and the codebase within the jar? Or is the still entered when executing the jar file?
Any help is greatly appreciated!
Thanks,
Jeremy
eric mcentee
Ranch Hand

Joined: May 02, 2001
Posts: 66
Jeremy-
For what its worth, I am creating executable jars and I am passing the -D options as well. I chose to do this not for extra points, but I felt that it was better way to get my project to the grader and have a bit more control over how its executed. I haven't had a great deal of luck with my RMI, it seems very fragile, so I figured the more I can control the better.
Hope that helps. If you want particulars, I'd be more than happy to share more ideas about this.
- Eric
eric mcentee
Ranch Hand

Joined: May 02, 2001
Posts: 66
Oh, I forgot to mention, I don't think you need the codebase. Someone can correct me if I'm wrong, but I generated the stub with the rmic -v1.2 option, and include that file in the client.jar. Then when the main class in the client manifest is executed, everything is good. To specify policy file, just do it the same way as if you were starting a class with just the java command.
- Eric
Jeremy Anderson
Greenhorn

Joined: Mar 28, 2002
Posts: 2
Thanks for the quick reply Eric. I seemed to need to specify the codebase when executing the server so the rmiregistry could download it. Otherwise, the rmiregistry would complain that it couldn't find the stub class. I guess what makes it work is what I'll stick with. I'm just putting on the finishing touches before I upload, and I'm afraid I'll just keep knitpicking and never go through with it.
I will try to use executable jars simply because the command for starting up the server cannot be typed in a WinME DOS prompt because it's too long (works fine on Win2000).
Thanks again!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: command line params and executable jars
 
Similar Threads
is it necessary
FBNS: Command line params server/client local/remote modes
Happy Days are Here. Finally. 151 :)
running a executable jar file from another program
starting service from java process