?? jvm.html
字號:
<?xml version="1.0" encoding="GB2312"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN"><head> <meta http-equiv="Content-Type" content="text/html; charset=GB2312" /> <meta name="keywords" content="electronic commerce, ecommerce, ebusiness, e-business, e-commerce, enterprise software, net economy, Sun Microsystems, Sun Open Net Environment, Sun ONE, internet software" /> <meta name="Description" content="Sun Microsystems, Inc. is delivering Sun ONE e-commerce software and enterprise solutions that enable companies to compete successfully in the Net Economy." /> <meta name="TemplateVersion" content="Sun ONE WDT 2.3.1" /> <meta name="LASTUPDATED" content="10/03/03 09:48:30" /> <meta name="BookTitle" content="Sun Java System Application Server Enterprise Edition 8.1 Administration Guide 2005Q1" /> <title>第 22 章 Java 虛擬機和高級設置</title> <link href="catalog.css" tppabs="http://docs.sun.com/source/819-1553/catalog.css" rel="stylesheet" type="text/css" /> <!-- on load bring this window to front --> <script laguage="javascript"> top.window.focus(); </script></head><body text="#000000" link="#594FBF" vlink="#9966cc" alink="#333366" bgcolor="#FFFFFF"><a name="top"> </a><!-- navigation --> <table width="100%" border="0" cellspacing="4" summary="Header navigation table"> <tr><td> <p class="pNavigation"> <a HREF="javascript:if(confirm('http://www.sun.com/software/ \n\n該文件無法用 Teleport Ultra 下載, 因為 它是一個域或路徑外部被設置為它的啟始地址的地址。 \n\n你想在服務器上打開它?'))window.location='http://www.sun.com/software/'" tppabs="http://www.sun.com/software/"> <img SRC="Logo.jpg" tppabs="http://docs.sun.com/source/819-1553/Logo.jpg" alt="Sun logo" valign="bottom" border="0" /></a>      <a href="monitor.html" tppabs="http://docs.sun.com/source/819-1553/monitor.html">上一頁</a>      <a href="index.html" tppabs="http://docs.sun.com/source/819-1553/index.html">目錄</a>      <a href="apache.html" tppabs="http://docs.sun.com/source/819-1553/apache.html">下一頁</a>      </p> </td></tr> <tr><td valign="top" align="right" bgcolor="#594FBF"> <span class="cBookTitle">Sun Java System Application Server Enterprise Edition 8.1 管理指南 2005Q1</span> </td></tr> </table><!-- end navigation --><blockquote><!-- chapter content --><a name="wp511876"> </a><h2 class="pChapNumber"><span class="cGray">第 22 章</span><br /><a name="wp511878"> </a>Java 虛擬機和高級設置</h2><a name="wp511880"> </a><p class="pParagraph">本章介紹了如何配置 Java 虛擬機 (JVM™) 和其他的高級設置。它包含以下各節:</p><div class="pSmartList1"><ul class="pSmartList1"><a name="wp511886"> </a><div class="pSmartList1"><li><a href="jvm.html#wp511896" tppabs="http://docs.sun.com/source/819-1553/jvm.html#wp511896">用于 JVM™ 設置的管理控制臺任務</a></li></div><a name="wp511892"> </a><div class="pSmartList1"><li><a href="jvm.html#wp512174" tppabs="http://docs.sun.com/source/819-1553/jvm.html#wp512174">用于高級設置的管理控制臺任務</a></li></div></ul></div><a name="wp511896"> </a><h2 class="pHeading1"><hr />用于 JVM™ 設置的管理控制臺任務</h2><div class="pSmartList1"><ul class="pSmartList1"><a name="wp511902"> </a><div class="pSmartList1"><li><a href="jvm.html#wp511934" tppabs="http://docs.sun.com/source/819-1553/jvm.html#wp511934">配置 JVM 常規設置</a></li></div><a name="wp511908"> </a><div class="pSmartList1"><li><a href="jvm.html#wp512004" tppabs="http://docs.sun.com/source/819-1553/jvm.html#wp512004">配置 JVM 類路徑設置</a></li></div><a name="wp511914"> </a><div class="pSmartList1"><li><a href="jvm.html#wp512054" tppabs="http://docs.sun.com/source/819-1553/jvm.html#wp512054">配置 JVM 選項</a></li></div><a name="wp511920"> </a><div class="pSmartList1"><li><a href="jvm.html#wp512102" tppabs="http://docs.sun.com/source/819-1553/jvm.html#wp512102">禁用安全管理器</a></li></div><a name="wp511926"> </a><div class="pSmartList1"><li><a href="jvm.html#wp512136" tppabs="http://docs.sun.com/source/819-1553/jvm.html#wp512136">配置 JVM 事件探查器設置</a></li></div></ul></div><a name="wp511934"> </a><h3 class="pHeading2">配置 JVM 常規設置</h3><a name="wp511936"> </a><p class="pParagraph">Java 虛擬機 (JVM) 包含在 Java 2 Standard Edition (J2SE™) 軟件中,它是 Application Server 所需的軟件。由于不正確的 JVM 設置將導致服務器停止運行,因此您應當謹慎地更改這些設置。 </p><a name="wp511938"> </a><p class="pParagraph">配置 Application Server 所使用的 JVM 的常規設置:</p><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp511940"> </a><div class="pSmartList1"><li>在樹組件中,選擇“Application Server”節點。</li></div><a name="wp511942"> </a><div class="pSmartList1"><li>單擊“JVM 設置”選項卡。</li></div><a name="wp511944"> </a><div class="pSmartList1"><li>默認情況下,選項卡下的“常規”鏈接已處于選取狀態。</li></div><a name="wp511946"> </a><div class="pSmartList1"><li>在“JVM 常規設置”頁面中,您可以指定以下內容:</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp511948"> </a><div class="pSmartList2"><li>在“Java 主目錄”字段中,輸入 Java 2 Standard Edition (J2SE) 軟件的安裝目錄名稱。</li></div><a name="wp511954"> </a><p class="pStepParaI2">Application Server 依賴于 J2SE 軟件運行。要驗證此版本是否支持您所指定的 J2SE 版本,請參閱發行說明。(請參見<a href="gstart.html#wp397424" tppabs="http://docs.sun.com/source/819-1553/gstart.html#wp397424">更多信息</a>一節中的鏈接。)</p><a name="wp511956"> </a><p class="pStepParaI2">注:如果輸入不存在的目錄名稱或輸入不受支持的 J2SE 軟件版本的安裝目錄名稱,則 Application Server 將無法啟動。</p><a name="wp511958"> </a><div class="pSmartList2"><li>在“Javac”字段中,鍵入 Java 編程語言編譯程序的命令行選項。</li></div><a name="wp511960"> </a><p class="pStepParaI2">當部署 EJB 組件后,Application Server 將運行編譯程序。</p><a name="wp511962"> </a><div class="pSmartList2"><li>要通過 JPDA(Java Platform Debugger Architecture)來設置調試,請選中“啟用調試”復選框并在“調試選項”字段中指定選項。</li></div><a name="wp511972"> </a><p class="pStepParaI2">JPDA 供應用程序開發者使用。有關更多信息,請參見《Application Server Developer's Guide》的 "Debugging J2EE Applications" 一章。(有關指向此指南的鏈接,請參見“<a href="gstart.html#wp397424" tppabs="http://docs.sun.com/source/819-1553/gstart.html#wp397424">更多信息</a>”。)</p><a name="wp511974"> </a><div class="pSmartList2"><li>在“RMI 編譯選項”字段中,鍵入 RMIC 編譯程序的命令行選項。</li></div><a name="wp511976"> </a><p class="pStepParaI2">當部署 EJB 組件后,Application Server 將運行 RMIC 編譯程序。</p><a name="wp511978"> </a><div class="pSmartList2"><li>在“字節碼預處理程序”字段中,鍵入以逗號分隔的類名列表。</li></div><a name="wp511980"> </a><p class="pStepParaI2">每個類都必須實現 <code class="cCode">com.sun.appserv.BytecodePreprocessor</code> 接口。將按指定順序調用這些類。 </p><a name="wp511986"> </a><p class="pStepParaI2">您也許需要在“字節碼預處理程序”字段中輸入某些工具(例如,事件探查器)。事件探查器生成用于分析服務器性能的信息。有關事件探查的更多信息,請參見《Application Server Developer's Guide》的 "Debugging J2EE Applications" 一章。</p></ol></div><a name="wp511988"> </a><div class="pSmartList1"><li>單擊“保存”。</li></div><a name="wp511990"> </a><div class="pSmartList1"><li>重新啟動服務器。</li></div></ol></div><a name="wp512004"> </a><h3 class="pHeading2">配置 JVM 類路徑設置</h3><a name="wp512006"> </a><p class="pParagraph">類路徑就是 JAR 文件的列表,Java 運行時環境將在此列表中搜索類和其他資源文件。</p><a name="wp512008"> </a><p class="pParagraph">要配置 Application Server 的 JVM 類路徑,請執行以下步驟:</p><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp512010"> </a><div class="pSmartList1"><li>在樹組件中,選擇“Application Server”節點。</li></div><a name="wp512012"> </a><div class="pSmartList1"><li>單擊“JVM 設置”選項卡。</li></div><a name="wp512014"> </a><div class="pSmartList1"><li>選擇選項卡下面的“路徑設置”鏈接。</li></div><a name="wp512016"> </a><div class="pSmartList1"><li>在“JVM 類路徑設置”頁面中,您可以指定以下內容:</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp512018"> </a><div class="pSmartList2"><li>在“環境類路徑”復選框中,保留默認選擇以忽略 CLASSPATH 環境變量。</li></div><a name="wp512020"> </a><p class="pStepParaI2">對于編程中的基本教程而言,CLASSPATH 環境變量使用起來很方便,但是不建議將此變量用于企業環境。</p><a name="wp512022"> </a><div class="pSmartList2"><li>要查看 Application Server 的類路徑,請檢查“服務器類路徑”字段中的只讀內容。</li></div><a name="wp512024"> </a><div class="pSmartList2"><li>要將一個 JAR 文件插入到服務器類路徑的開頭,請在“類路徑前綴”字段中輸入此文件的完整路徑名。</li></div><a name="wp512026"> </a><div class="pSmartList2"><li>要將一個 JAR 文件添加到服務器類路徑的末尾,請在“類路徑后綴”字段中輸入此文件的完整路徑名。</li></div><a name="wp512032"> </a><p class="pStepParaI2">例如,假設您要指定數據庫驅動程序的 JAR 文件。請參見<a href="jdbc.html#wp92623" tppabs="http://docs.sun.com/source/819-1553/jdbc.html#wp92623">集成 JDBC 驅動程序</a>。</p><a name="wp512034"> </a><div class="pSmartList2"><li>在“本地庫路徑前綴”和“本地庫路徑后綴”字段中,您可以將條目添加到本地庫路徑的開頭或末尾。</li></div><a name="wp512036"> </a><p class="pStepParaI2">將服務器的本地共享庫的相對路徑、標準 JRE 本地庫路徑、shell 環境設置(UNIX 中的 LD_LIBRARY_PATH)以及在“JVM 事件探查器設置”頁面中指定的任意路徑順序連接起來就構成了本地庫路徑。</p></ol></div>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -