箱_圾_垃

MyEclipse中增加Tomca启动使用内存
window->preferences->myeclipse ->application server->tomcat 5->jdk->optional java jvm arguments里加:
-Xms256m -Xmx512m -Xss4M -XX:MaxPermSize=256m
-----------------------------

中文转16进制的指令: C:\Program Files\Java\jdk1.6.0_12\bin\native2ascii.exe -encoding gbk d:\a.txt d:\b.txt
-----------------------------

调试参数: -Xms256m -Xmx256m -XX:PermSize=128M -XX:MaxPermSize=300M
--------------------------
/**
     * 获取容器控件的默认颜色
     * @return Color
     */
    public static Color getCompositeDefaultColor()
    {
        int a = OS.GetSysColor(OS.COLOR_BTNFACE);
        int x = a / 65536;
        int y = a / 256 % 256;
        int z = a % 256;
        return new Color(Display.getDefault(), z, y, x);
    }
  int defaultBackground () {
if (OS.IsWinCE) return OS.GetSysColor (OS.COLOR_WINDOW);
return OS.GetSysColor (OS.COLOR_BTNFACE);
}
--------------------------
//桌面路径
FileSystemView fsv = FileSystemView.getFileSystemView();
        File file = fsv.getHomeDirectory();      
         for (String string : file.list())
        {
            System.out.println(string);
        }
--------------------------
//获取当前计算机的IP地址
InetAddress ip = InetAddress.getLocalHost();
System.out.println("获取当前计算机的IP名称: " + ip.getHostName());
System.out.println("获取当前计算机的IP地址: " + ip.getHostAddress());
--------------------------
//获取配置信息
Properties properties = new Properties();
public String getConfigInfo(String name)
    {
        try
        {
            InputStream in = getClass().getResourceAsStream("a.properties"); //$NON-NLS-1$
            properties.load(in);
            in.close();
        }
        catch (IOException e)
        {
        }
        finally
        {
            String a = properties.getProperty(name);
            if (a == null && a.length() > 0)
            {
                return a;
            }
        }
        return ""; //$NON-NLS-1$
    }

a.properties文件
add=com.hw.xbliuc.CAdd
sub=com.hw.xbliuc.CSub
mul=com.hw.xbliuc.CMul
div=com.hw.xbliuc.CDiv
--------------------------
for (int i = 1; i < 10; i++)
{
for (int j = 1; j < i + 1; j++)
{
System.out.print(j + "*" + i + "=" + i * j + "\t");
}
System.out.println();
}

你可能感兴趣的:(jvm,tomcat,MyEclipse,OS,J#)