home *** CD-ROM | disk | FTP | other *** search
/ Internet News 1999 October / INEWS_10_CD.ISO / pc / jdk / jdk1.2.2 / docs / guide / rmi / examples / stock / run.bat < prev    next >
Encoding:
DOS Batch File  |  1999-09-19  |  2.2 KB  |  79 lines

  1. @echo off
  2. set TOPDIR=..\..
  3.  
  4. rem  This BAT script explains and carries out the process of compiling
  5. rem  and running the stock example.  The important commands are
  6. rem  summarized here (assuming that ..\.. is in your CLASSPATH):
  7. rem
  8. rem    javac -d ..\.. *.java
  9. rem    rmic -d ..\.. examples.stock.StockServer examples.stock.StockApplet
  10. rem    java -Djava.security.policy=security.policy examples.stock.StockServer
  11. rem    appletviewer index.html
  12.  
  13. echo ************************************************************************
  14. echo *
  15. echo * This script goes through the complete process of compiling and
  16. echo * running the stock example on your local machine.
  17. echo *
  18. echo * (The stock server is bundled with its own registry, so there
  19. echo * is no need to create one.)
  20. echo *
  21. echo * To compile and run server, temporarily add root directory
  22. echo * of these classes (..\..) to CLASSPATH...
  23. echo *
  24. @echo on
  25. set ORIGCLASSPATH=%CLASSPATH%
  26. set CLASSPATH=%TOPDIR%;%CLASSPATH%
  27. @echo off
  28.  
  29. echo *
  30. echo * Compile all Java sources files...
  31. echo *
  32. @echo on
  33. javac -d %TOPDIR% *.java
  34. @echo off
  35.  
  36. echo *
  37. echo * Run rmic to generate stub and skeleton classes for StockServer
  38. echo * StockApplet...
  39. echo *
  40. @echo on
  41. rmic -d %TOPDIR% examples.stock.StockServer examples.stock.StockApplet
  42. @echo off
  43.  
  44. echo *
  45. echo * Start the server examples.stock.StockServer...
  46. echo *
  47. @echo on
  48. start java -Djava.security.policy=security.policy examples.stock.StockServer
  49. @echo off
  50.  
  51. echo *
  52. echo * Please wait until a message appears in the server process's window
  53. echo * indicating that it has been bound to the registry.
  54. echo *
  55. pause
  56.  
  57. echo *
  58. echo * Restore the original CLASSPATH at this point, so that the appletviewer
  59. echo * will not have any of these example classes locally available through
  60. echo * CLASSPATH.  Therefore, it must load them through the codebase...
  61. echo *
  62. @echo on
  63. set CLASSPATH=%ORIGCLASSPATH%
  64. @echo off
  65.  
  66. echo *
  67. echo * Start the appletviewer...
  68. echo *
  69. @echo on
  70. appletviewer index.html
  71. @echo off
  72.  
  73. echo *
  74. echo * If all the preceding steps were successful, the server
  75. echo * process is still running.  You can manually destroy this window
  76. echo * to clean up before running this script again.
  77. echo *
  78.  
  79.