This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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
Joined: May 02, 2001
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
Joined: Mar 28, 2002
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!