Starting the RMI Server in Linux using batch file
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, December 20, 2001 04:46 AM

Dear All, I am trying to write a batch file in Linux to execute the RMI Server for my application. set path=C:Progra~1JavaSoftjre1.2 in set classpath= start rmiregistry 1099 set classpath=.;Jarsclasses12_01.zip;Jarsjgl3.1.0.jar;Jarsmail.jar;Jarsactivation.jar;Jarsjt400Access.zip;Jarsimap.jar;jars as.jar;jarslog4j.jar;jarsmailapi.jar;jarspop3.jar;jarssmtp.jar;c:CaterlinkRMIServeraircanadaClasses;c:CaterlinkRMIServeraircanadajarsjgl3.1.0.jar; java -Djava.security.policy=java.policy -Djava.rmi.server.hostname=172.22.2.239 com.cit.caterlinkserver.CaterLinkServer 172.22.2.239:1099 pause This is t   More>>

Dear All,


I am trying to write a batch file in Linux to execute the RMI Server for my application.


set path=C:Progra~1JavaSoftjre1.2 in


set classpath=


start rmiregistry 1099


set


classpath=.;Jarsclasses12_01.zip;Jarsjgl3.1.0.jar;Jarsmail.jar;Jarsactivation.jar;Jarsjt400Access.zip;Jarsimap.jar;jars
as.jar;jarslog4j.jar;jarsmailapi.jar;jarspop3.jar;jarssmtp.jar;c:CaterlinkRMIServeraircanadaClasses;c:CaterlinkRMIServeraircanadajarsjgl3.1.0.jar;


java -Djava.security.policy=java.policy


-Djava.rmi.server.hostname=172.22.2.239


com.cit.caterlinkserver.CaterLinkServer 172.22.2.239:1099


pause


This is the sample code written in the Windows OS to run the Server Application.


Please guide me to write the bat file in Linux Environment.


Moreover, in the Windows envirionment the JDK is installed in the Program Files directory.Could anyone tell me where will it be installed in the Linux.


I also have the problem of setting the PATH and CLASSPATH variable.


I would be grateful if anyone of you can state the exact code similar to the above for Linux environment.


Thanks


Magesh K G

   <<Less

Re: Starting the RMI Server in Linux using batch file

Posted By:   Nathan_Meyers  
Posted On:   Thursday, December 20, 2001 10:09 AM

Since you're moving from Windows, here's a how-to you might find useful. Among other things, it focuses on migrating your .bat programming knowledge to the bash shell used in Linux.

Re: Starting the RMI Server in Linux using batch file

Posted By:   ryan_wexler  
Posted On:   Thursday, December 20, 2001 10:01 AM

You will have to install the jdk on your linux box as well as all the classpath packages. You can put them wherever you want there is no set place for this, since you will be setting the location in the path and classpath environment variables.

When setting your path and classpath environment variables you have many options. One is to do it in a script which runs the java class or another is you could set it up in your user environment. In your home user directory there is a file .bash_profile you can set them in there. If you set them in there it will set them every time you login as that user and will be global to that user environment. To set an environment variable feel do this:

PATH=/path/to/jdk/bin:/another/path/variable:/and/another; export PATH

CLASSPATH=/path/to/package:/another/package:/and/another; export CLASSPATH

The export command is very important you must do this.

To create a script to run this stuff, create a new file. Edit the file. If you are setting your environment variables in the script do this at the beginning. Then to start rmiregistry on its own line put: rmiregistry. However you probably want to run rmi as a background process so the script can go about it's business. So add a & to the end of it.

rmiregistry &

The ampersand puts will make it run as a background process. THen do the same thing with your java command

java -Djava.security.policy=java.policy -Djava.rmi.server.hostname=172.22.2.239 com.cit.caterlinkserver.CaterLinkServer 172.22.2.239:1099 &

Then save your script file. One last thing you will have to do is change the permissions of the file so it is executable. Type chmod a+x scriptfilename.

THen to run it type /path/to/scriptfile/scriptfilename
About | Sitemap | Contact