Java environment settings and Chinese questions

xiaoxiao2021-03-06  14

1: Java Development System Environment Variable Settings (JDK): Methods: Win2000 / WinXP: Right-click My Computer - "Properties -" Advanced - "Environmental Variable ClassPath = .; JDK installation / libpath = jdk Installing a directory / bin Note: It must not be ignored ".". Win98: Modifying AutoCexe.bat is to modify the automatic batch file. Add: set classpath = .; JDK installation / libset Path = JDK installation directory / bin;% Path% Linux: Assume JDK installed under /Home/jdk1.4.0/, open / etc / profile, where: Path = "/ home / jdk1.4.0 / bin: $ path" classpath =.: / home / jdk1.4.0 / jre / lib / rt.jar: /Home/jdk1.4.0/lib/tools.jarjava_home=/home/jdk1 .4.0export path ClassPath Java_Home2: (Prerequisite to set the system environment variable) Do not compile the bag, quite simple: Javajava class name: Compilation problem with bag: If your class is packaged, you should use Compile: JavaJava package name. Javajava package name. Javajava package name. Class name 3: Tomcat server configuration: 1): Set the system environment variable. 2): java_home = g: /jbuilder6/jdk1.3.1 g: /jbuilder6/jdk1.3.1 is a JDK installation directory 3): Tomcat_Home = Tomcat installation directory 4: Modify the Serlet without restart Tomcat modification% Tomcat_Home% / conf / server .xml is approximately as follows: where reloadable is configured to automatically reload, set it to true, if this is not on.

5: Modify the servlet in WebShpere without restarting the service: Modify ../web-inf below Web.xml: Join where reloadInterval =" 3 "reloadingEnabled =" true "fileServingEnabled =" true "directoryBrowsingEnabled =" true "serveServletsByClassnameEnabled = "true" is the main, reloadinterval = "3" reloadingenabled = "true" is to automatically reload 3 seconds after modification. 6: Configure JBuilder6 WebShpere4.0ae, in fact, JB7 can refer to: first install J2EE, then add J2EE to the JB of Libraries. The method is as follows 1 :) Tools ---> configure libraries -> new ---> name: Fill in J2EE, location: The default is old. ----> Add -> Select the J2EE installation path, select the lib folder - OK - OK. 2 :) Return to Configure Libraries, select Required Libraries -> Add - "Select you. J2EE created, you can click OK. Then configure the WebShpere application server and Database Pilot: The first step: Tools -> Enterprise Setup -> Application Servers Set the installation path and the IBM's Java path, DB2 you look at your second step: Project -> Defaults Project Properties Servers Select WS4.0 and should be able to use WebShpere4.0 does not support EJB2.0, WebShpere5.0 support.

Configuring Database Pilot Step 1: Add Category Library Tools -> Config Libraries Add Your Database Driver Table 2: Tools -> Enterprise Setup -> Database Drivers Add the class library you just added to the third step : After restarting JBilder, Tools -> DATABASE PILOT -> Option -> Drivers, add driver Step 4: New construction in Database Pilot Point, Driver: com.ibm.db2.jdbc.app.db2driver.

URL: JDBC: DB2: DB_SDBC. (DB_SDBC is a DB2 database on the server). 7: Solve the Java Chinese Question: For Applet and AWT: 1 :) font f = new font (UIResource.getstring ("default_font", font. Plain, 12); UIManager.Put ("label.font", f); uimanager.put ("label.Foreground", color.black; uimanager.put; uimanager.put "Menu.font", f); uimanager.put ("MenuItem.font", f); uimanager.put ("list.font", f); UIManager.put ("Checkbox.Font", F); UIManager. PUT ("Radiobutton.font", F); UIManager.Put ("ComboBox.Font", F); UIManager.put ("TextArea.font", F); 2 :) font f = new font ("Lishu", Font.Plain, 15); UIManager.Put ("Button.Font", Font); UIManager.put ("ToggleButton.Font", Font); UIManager.put ("Radiobutton.Font", Font); UIManager.put "Checkbox.Font", font; uimanager.put ("colorchooser.font", font); UIManager.put ("ToggleButton.font", font); UIManager.Put ("ComboBox.Font", font); UIManager. PUT ("ComboBoxItem.font", FONT UIManager.Put ("INTERNALFRAME.TILEFONT", FONT); UIManager.put ("Label.Font", font); UIManager.put ("list.font", font); UIManager.put ("MenuBar.Font" , font; uimanager.put; UIManager.put ("MenuItem.font", font); UIManager.put ("RadiobuttonMenuItem.font", font); UIManager.put ("CheckBoxMenuItem. Font ", font); UIManager.put (" Popupmenu.Font ", FONT);

UIManager.put ("optionpane.font", font; uimanager.put; uimanager.put ("progressbar.font", font); UIManager.put ("scrollpane.font", font ); Uimanager.put; uimanager.put ("tabbedpane.font", font); UIManager.put ("TableHeader.Font", font); UIManager.put ("Textfield.Font", font UIManager.put ("passwordfiled.font", font); UIManager.put ("textarea.font", font); uimanager.put ("TextPane.Font", font); UIManager.put ("EditorPane.Font" , font); UIManager.Put ("Titledborder.font", font); UIManager.put ("Toolbar.Font", Font); UIManager.put ("Tooltip.Font", Font); UIManager.put ("Tree. Font ", font); 3 :) For JSP and Servlet: Solution: First: In JSP page Add: <% @ Page ContentType =" Text / HTML; Charset = GB2312 "%> or in servlet Public Void DOGET HTTPSERVLETREQUEST REQUEST, HTTPSERVLETRESPONSE RESPONSE) THROWS ServleTexception, IOException {response.setcon TENTTYPE ("text / html; charset = GB2312"); // This is an important above if you use the following method to call before the data is stored: public static string unicoidetoChinese (String s) {{ix ({ix) s == null || S.Equals (")) Return" "; string newstring = null; newstring = new string (s.GetBytes (" ISO8859_1 ")," GB2312 "); return.com;} catch (unsupportedEncodingexception E ) {RETURN S;}} public static string chinesetounicode (string s) {try {if (s == null || s.equals (")) Return" "

转载请注明原文地址:https://www.9cbs.com/read-50976.html

New Post(0)