Hi Team,

I have learned RMI Applcation basics.I have a Doubt in setting the Codebase and security policy file in the program during compile time itself rather than manually giving it during run time .

During run time we will give like below in the command prompt,

C:>java -cp .;c:\hello.jar -Djava.rmi.server.codebase=file:/c:/hello.jar -Djava
.security.policy=server.policy server.Server

Is there a way to set the " -Djava.rmi.server.codebase=file:/c:/hello.jar -Djava
.security.policy=server.policy "
in the program itself during complie time and then while running

can we simply give like this

java -cp . Server.server

Please advise if there is any method available to achieve this ....

AFAIK, not possible without code modifications. The simplest thing would be to just create a script (.bat or .sh file) and run the script everytime instead of typing out the entire command...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.