Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SUN's RMI Tutorial - Help Please!  RSS feed

 
David Edelstein
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to run the Tutorial from SUN on RMI.
http://java.sun.com/docs/books/tutorial/rmi/running.html
I'm having trouble entering the following java command in MS-Dos:
java -Djava.rmi.server.codebase=file:/c:\home\jones\public_html\classes/
-Djava.security.policy=java.policy
client.ComputePi zaphod.east.sun.com 20
the Dos prompt in Windows Millenium only allows a maximum of 127 characters. How can I run these commands which are longer then the allowed input at my Dos prompt?
Thanks in advance.
David
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have a copy of that version of Windows, by try entering 'cmd' in Start -> Run... I believe that command-line window doesn't have the same restrictions as COMMAND.COM.
If that's not an available option, or you want to be fancy about it, you could write a properties file to contain the values you're currently invoking on the command line with -D directives. You then would have to include code to read in the properties file at runtime. But it does have the more general advantage of reducing the typing you have to do for each run.
A properties file is simple. Let's say you have the following in a file called rmi.properties:

In your code, you'd then load these values in with a FileInputStream and replace the defaults with set calls. It'll save you a lot of fuss over multiple iterations.
 
David Edelstein
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,
Thanks for the suggestions. Unfortunately, it looks like the cmd program isn't available on my version of Windows Millenium. I like your idea about the properties file and am going to persue that route.
Thanks again
David
 
Nasser Aboobaker
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,
I dont know you still need a solution for this. But you can acheive this easily by creating a batch file and calling it.
open your dos window and type edit rmiscript.bat
a new window will open. In that window you can fill in whatever you want and save it under where ever you want. Let us say you have saved it under c:\myfolder
go to c:\myfolder in dos window and type rmiscript
it will run whatever you have put in rmiscript.bat and easy to handle.
Nasser
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!