选择显示字体大小

java环境设置及中文问题祥解

1:java开发中系统环境变量设置(jdk):
方法如下:
win2000/winxp中:
右键我的电脑--》属性--》高级--》环境环境变量
classpath=.;jdk安装目\lib
path=jdk安装目录\bin
注意:一定不可忽略“.”。
win98中:
修改autocexe.bat 就是修改自动批处理文件。
添加:
set classpath=.;jdk安装目\lib
set path=jdk安装目录\bin;%path%
linux中:
假设jdk安装在/home/jdk1.4.0/下,打开/etc/profile,在其中加入:
path="/home/jdk1.4.0/bin:$path"
classpath=.:/home/jdk1.4.0/jre/lib/rt.jar:/home/jdk1.4.0/lib/tools.jar
java_home=/home/jdk1.4.0
export path classpath java_home
2:(前提设置好了系统环境变量)
不带包的编译,相当简单:
javac 类名.java
java 类名
关于带包的编译问题:
如果你的类是带包的,应该用如下方法编译:
javac -d  包的父目录 类名.java
java  包名.类名

3:tomcat服务器配置:
   1):设置好系统环境变量。
   2):java_home=g:\jbuilder6\jdk1.3.1
     g:\jbuilder6\jdk1.3.1为jdk安装目录
   3):tomcat_home=tomcat安装目录
4:修改serlet而不重新启动tomcat修改
%tomcat_home%\conf\server.xml
大致如下:
<context path=&quot;&quot; docbase=&quot;root&quot; debug=&quot;0&quot;  reloadable=&quot;true&quot;/>
其中reloadable就是配置是否自动reload的,把它设为true,如果没有这一项,加上。
5:修改webshpere中的servlet而不重新启动服务:
修改..\web-inf下面的web.xml:
加入

<webappext:webappextension xmi:version=&quot;2.0&quot; xmlns:xmi=&quot;http://www.omg.org/xmi&quot; xmlns:webappext=&quot;webappext.xmi&quot; xmlns:webapplication=&quot;webapplication.xmi&quot; xmlns:xsi=&quot;http://www.w3.org/2001/xmlschema-instance&quot; xmi:id=&quot;webapp_id_ext&quot; reloadinterval=&quot;3&quot; reloadingenabled=&quot;true&quot; fileservingenabled=&quot;true&quot; directorybrowsingenabled=&quot;true&quot; serveservletsbyclassnameenabled=&quot;true&quot;>其中reloadinterval=&quot;3&quot; reloadingenabled=&quot;true&quot; fileservingenabled=&quot;true&quot; directorybrowsingenabled=&quot;true&quot; serveservletsbyclassnameenabled=&quot;true&quot;是主要的,reloadinterval=&quot;3&quot; reloadingenabled=&quot;true&quot; 是说修改后3秒自动重新载
入。

6:配置jbuilder6+webshpere4.0ae,其实jb7可以参照:
首先安装j2ee,然后把j2ee加入到jb的libraries里面。方法如下
  1:)tools--->configure libraries-->new--->name:里面填写j2ee,location:里面默认的旧可以了。---->add-->选在j2ee安装路径,选中lib文件夹--ok--ok.
 2:)返回到configure libraries也面后,选中required libraries-->add--》选中你刚才创建的j2ee,点ok就可以了。
然后配置webshpere应用服务器和database pilot:
第一步:tools-->enterprise setup-->application servers设置安装路径以及ibm的java路径,db2你自己看着办
第二步:project-->defaults project properties里servers选择ws4.0,应该可以用了
webshpere4.0不支持ejb2.0,webshpere5.0支持。
配置database pilot
第一步:添加类库tools-->config libraries添加你的数据库驱动程序类
第二步:tools-->enterprise setup-->database drivers里面添加你刚添加的那个类库
第三步:重启jbilder后,tools-->database pilot-->option-->drivers,添加驱动程序
第四步:在database pilot点新建就可以了,driver:com.ibm.db2.jdbc.app.db2driver。url:jdbc:db2:db_sdbc.(db_sdbc为服务器上的db2数据库).
7:解决java中文问题:
针对applet和awt:
  
 1:)
    font f = new font(uiresource.getstring(      &quot;default_font&quot;),font.plain,12);
      uimanager.put(&quot;label.font&quot;,f);
      uimanager.put(&quot;label.foreground&quot;,color.black);
      uimanager.put(&quot;button.font&quot;,f);
      uimanager.put(&quot;menu.font&quot;,f);
      uimanager.put(&quot;menuitem.font&quot;,f);
      uimanager.put(&quot;list.font&quot;,f);
      uimanager.put(&quot;checkbox.font&quot;,f);
      uimanager.put(&quot;radiobutton.font&quot;,f);
      uimanager.put(&quot;combobox.font&quot;,f);
      uimanager.put(&quot;textarea.font&quot;,f);


    2:)
      font f = new font(&quot;隶书&quot;,font.plain,15);
           uimanager.put(&quot;button.font&quot;,font);
            uimanager.put(&quot;togglebutton.font&quot;,font);
            uimanager.put(&quot;radiobutton.font&quot;,font);
            uimanager.put(&quot;checkbox.font&quot;,font);
            uimanager.put(&quot;colorchooser.font&quot;,font);
            uimanager.put(&quot;togglebutton.font&quot;,font);
            uimanager.put(&quot;combobox.font&quot;,font);
            uimanager.put(&quot;comboboxitem.font&quot;,font);
            uimanager.put(&quot;internalframe.titlefont&quot;,font);
            uimanager.put(&quot;label.font&quot;,font);
            uimanager.put(&quot;list.font&quot;,font);
            uimanager.put(&quot;menubar.font&quot;,font);
            uimanager.put(&quot;menu.font&quot;,font);
            uimanager.put(&quot;menuitem.font&quot;,font);
            uimanager.put(&quot;radiobuttonmenuitem.font&quot;,font);
            uimanager.put(&quot;checkboxmenuitem.font&quot;,font);
            uimanager.put(&quot;popupmenu.font&quot;,font);
            uimanager.put(&quot;optionpane.font&quot;,font);
            uimanager.put(&quot;panel.font&quot;,font);
            uimanager.put(&quot;progressbar.font&quot;,font);
            uimanager.put(&quot;scrollpane.font&quot;,font);
            uimanager.put(&quot;viewport&quot;,font);
            uimanager.put(&quot;tabbedpane.font&quot;,font);
            uimanager.put(&quot;tableheader.font&quot;,font);
            uimanager.put(&quot;textfield.font&quot;,font);
            uimanager.put(&quot;passwordfiled.font&quot;,font);
            uimanager.put(&quot;textarea.font&quot;,font);
            uimanager.put(&quot;textpane.font&quot;,font);
            uimanager.put(&quot;editorpane.font&quot;,font);
            uimanager.put(&quot;titledborder.font&quot;,font);
            uimanager.put(&quot;toolbar.font&quot;,font);
            uimanager.put(&quot;tooltip.font&quot;,font);
            uimanager.put(&quot;tree.font&quot;,font);

 3:)针对jspservlet
解决办法:
第一:
jsp页面加入:
<%@ page contenttype=&quot;text/html; charset=gb2312&quot; %>
或者在servlet里面
  public void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception {
    response.setcontenttype(&quot;text/html; charset=gb2312&quot;);//这是重要的
上面的如果在不行就用如下的方法在数据入库前进行调用:
public static string unicodetochinese(string s){
  try{
     if(s==nulls.equals(&quot;&quot;)) return &quot;&quot;;
     string newstring=null;
     newstring=new string(s.getbytes(&quot;iso8859_1&quot;),&quot;gb2312&quot;);
     return newstring;
    }
  catch(unsupportedencodingexception e)
  {
  return s;
  }
  }

public static string chinesetounicode(string s){
  try{
  if(s==nulls.equals(&quot;&quot;)) return &quot;&quot;;
  string newstring=null;
  newstring=new string(s.getbytes(&quot;gb2312&quot;),&quot;iso8859_1&quot;);
   return newstring;
  }
  catch(unsupportedencodingexception e)
  {
  return s;
}
  }
3:)解决weblogicwebshpere中文问题:
web.xml文件中需要配置中文环境。r如下:
<context-param>
  <param-name>weblogic.httpd.inputcharset./*</param-name>
  <param-value>gb2312</param-value>
</context-param>


bill-转自:csdn


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons