﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-蓝胖的java世界</title><link>http://www.blogjava.net/fanaidehua/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 06:07:24 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 06:07:24 GMT</pubDate><ttl>60</ttl><item><title>jsp传递中文乱码解决方法</title><link>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432616.html</link><dc:creator>蓝胖</dc:creator><author>蓝胖</author><pubDate>Mon, 19 Jun 2017 06:46:00 GMT</pubDate><guid>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432616.html</guid><wfw:comment>http://www.blogjava.net/fanaidehua/comments/432616.html</wfw:comment><comments>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432616.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/fanaidehua/comments/commentRss/432616.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/fanaidehua/services/trackbacks/432616.html</trackback:ping><description><![CDATA[<pre id="best-content-589409054" accuse="aContent"  mb-10"="" style="font-size: medium; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, &quot;courier new&quot;, courier, 宋体, monospace; white-space: pre-wrap; word-wrap: break-word; color: #333333; line-height: 24px; background-color: #f1fedd;">request.setCharacterEncoding("UTF-8")页面也需要设置转码的：<br />页面：(.jsp)<br />&lt;%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%&gt;<br />response.setContentType("text/html;charset=UTF-8");<br /><br />处理文件：（.java）<br />转码的三种方法：<br />A 接受参数时进行编码转换<br /><br />String str = new String(request.getParameter("something").getBytes("ISO-8859-1"),"utf-8")； 这样的话，每一个参数都必须这样进行转码。很麻烦。但确实可以拿到汉字。<br /><br />B 在请求页面上开始处，执行请求的编码代码， request.setCharacterEncoding("UTF-8")，把提交内容的字符集设为UTF－8。这样的话，接受此参数的页面就不必在转码了。直接使用<br />String str = request.getParameter("something")；即可得到汉字参数。但每页都需要执行这句话。<br /><br />这个方法也就对post提交的有效果，对于get提交和上传文件时的enctype="multipart/form-data"是无效的。稍后下面单独对这个两个的乱码情况再进行说明。<br /><br />C 为了避免每页都要写request.setCharacterEncoding("UTF-8")，建议使用过滤器对所有jsp进行编码处理。 <br /><br />新手可以暂时不考虑过滤器的方法，过滤器一般都会涉及到配置开发，要修改web.xml，还算是比较麻烦的，建议接触java一段时间后再考虑使用过滤器的方法。或者如果应用了struts框架，可以查看struts的转码过滤器配置。<br />实际例子：<pre id="best-content-589409054" accuse="aContent"  mb-10"="" style="margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, &quot;courier new&quot;, courier, 宋体, monospace; white-space: pre-wrap; word-wrap: break-word;">&lt;%request.setCharacterEncoding("UTF-8")%&gt;放在jsp&lt;head&gt;&lt;/head&gt;之间<br />jspforward.jsp<br /><div>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%&gt;     &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;title&gt;Insert title here&lt;/title&gt; &lt;% request.setCharacterEncoding("UTF-8");%&gt; &lt;/head&gt; &lt;body&gt;  &lt;jsp:forward page="/forwardresult.jsp"&gt; &lt;jsp:param name="name" value="李海"&gt;&lt;/jsp:param&gt; &lt;jsp:param name="age" value="29"&gt;&lt;/jsp:param&gt; &lt;/jsp:forward&gt; &lt;/body&gt; &lt;/html&gt;<br />jspresult.jsp<br /><div>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;title&gt;Insert title here&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;%=request.getParameter("name")%&gt; &lt;%=request.getParameter("age")%&gt; &lt;/body&gt; &lt;/html&gt;</div></div></pre><br /><br /></pre><img src ="http://www.blogjava.net/fanaidehua/aggbug/432616.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/fanaidehua/" target="_blank">蓝胖</a> 2017-06-19 14:46 <a href="http://www.blogjava.net/fanaidehua/archive/2017/06/19/432616.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jsp访问mysql数据库 class not found</title><link>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432617.html</link><dc:creator>蓝胖</dc:creator><author>蓝胖</author><pubDate>Mon, 19 Jun 2017 06:46:00 GMT</pubDate><guid>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432617.html</guid><wfw:comment>http://www.blogjava.net/fanaidehua/comments/432617.html</wfw:comment><comments>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432617.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/fanaidehua/comments/commentRss/432617.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/fanaidehua/services/trackbacks/432617.html</trackback:ping><description><![CDATA[<div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal; padding-top: 5px; padding-bottom: 5px;"><span style="background-color: #ffffff;">遇到问题：com.mysql.jdbc.Driver class not found 我在项目中的WEB-INF/lib中添加mysql-connector-java-5.6-bin jar包后在eclipse中选中项目刷新，在lib中选中mysql-connector-java-5.6-bin jar右键点击addbulidPath成功解决问题 完整的代码如下：</span></div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;"><br />&lt;%@page import="java.sql.DriverManager" import="java.sql.Connection" import="java.sql.Statement"&nbsp;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">import="java.sql.ResultSet" %&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;%@ page language="java" contentType="text/html; charset=UTF-8"</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&nbsp; &nbsp; pageEncoding="UTF-8"%&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;html&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;head&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;title&gt;Insert title here&lt;/title&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/head&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;body&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;%</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">Class.forName("com.mysql.jdbc.Driver");</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">Statement stmt=conn.createStatement();</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">String sql="select * from person ";</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">ResultSet rs=stmt.executeQuery(sql);</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">%&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;table bgcolor="green" border="1"&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;tr&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;id&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;name&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;sex&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;age&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/tr&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;%</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">while(rs.next()){</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">%&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;"></div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;tr&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;&lt;%=rs.getString("id") %&gt;&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;&lt;%=rs.getString("name") %&gt;&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;&lt;%=rs.getString("sex") %&gt;&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;&lt;%=rs.getString("age")%&gt;&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/tr&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;% }%&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/table&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/body&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/html&gt;</div><img src ="http://www.blogjava.net/fanaidehua/aggbug/432617.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/fanaidehua/" target="_blank">蓝胖</a> 2017-06-19 14:46 <a href="http://www.blogjava.net/fanaidehua/archive/2017/06/19/432617.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse 一直提示 loading descriptor for 解决</title><link>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432614.html</link><dc:creator>蓝胖</dc:creator><author>蓝胖</author><pubDate>Mon, 19 Jun 2017 06:45:00 GMT</pubDate><guid>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432614.html</guid><wfw:comment>http://www.blogjava.net/fanaidehua/comments/432614.html</wfw:comment><comments>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432614.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/fanaidehua/comments/commentRss/432614.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/fanaidehua/services/trackbacks/432614.html</trackback:ping><description><![CDATA[<span style="font-size: medium; line-height: normal; color: #464646; font-family: simsun; background-color: #f8ecd8;">第一次没有找到所以截图下来<br />你Eclipse左侧的Project Explorer 最右上角有一个小钮,鼠标移上去时提示"View Menu".<br /><br /><img src="http://www.blogjava.net/images/blogjava_net/smallsunshine/%E6%AD%A5%E9%AA%A41.png" width="728" height="386" alt="" style="border: none;" /><br /><br /></span><br style="font-size: medium; line-height: normal; color: #464646; font-family: simsun; background-color: #f8ecd8;" /><span style="font-size: medium; line-height: normal; color: #464646; font-family: simsun; background-color: #f8ecd8;">你点一下,在弹出的上下文菜单中选择"Customize View..." 弹出一个对话框.<br /><img src="http://www.blogjava.net/images/blogjava_net/smallsunshine/%E6%AD%A5%E9%AA%A42.png" width="476" height="511" alt="" style="border: none;" /><br /><br /></span><br style="font-size: medium; line-height: normal; color: #464646; font-family: simsun; background-color: #f8ecd8;" /><span style="font-size: medium; line-height: normal; color: #464646; font-family: simsun; background-color: #f8ecd8;">你选择: Content 选项卡,在里面把没用的去掉就行了 J2EE WEB loading descriptor .<br /><img src="http://www.blogjava.net/images/blogjava_net/smallsunshine/%E6%AD%A5%E9%AA%A43.png" width="487" height="520" alt="" style="border: none;" /></span><img src ="http://www.blogjava.net/fanaidehua/aggbug/432614.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/fanaidehua/" target="_blank">蓝胖</a> 2017-06-19 14:45 <a href="http://www.blogjava.net/fanaidehua/archive/2017/06/19/432614.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>解决MyEclipse吃内存,让MyEclipse速度飞起来</title><link>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432613.html</link><dc:creator>蓝胖</dc:creator><author>蓝胖</author><pubDate>Mon, 19 Jun 2017 06:43:00 GMT</pubDate><guid>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432613.html</guid><wfw:comment>http://www.blogjava.net/fanaidehua/comments/432613.html</wfw:comment><comments>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432613.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/fanaidehua/comments/commentRss/432613.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/fanaidehua/services/trackbacks/432613.html</trackback:ping><description><![CDATA[<p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">前言：MyEclipse5.5 大小 139M；MyEclipse6.5 大小 451M；MyEclipse7.0 大小 649M！下载服务器又是国外的。。。下载速度累人也就罢了，只要你工作性能一流。不幸的是，MyEclipse 属于狂吃内存的主，特别是 MyEclipse7.0 运行起来，基本上不用干其他工作了，它是一会Quick update，一会 updating indexes ，你耐着性子等它 update 完，它老人家又开始自动 validation 了！</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">实在忍无可忍，作者收集了一些关于解决 MyEclipse 的耗内存的办法，经本人测试非常有效，共享出来，希望可以方便更多的朋友。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">1 老是弹出Quick update error 、关闭myeclipse的Quick Update自动更新功能</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br /><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">这个问题的解决办法是关闭自动更新</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">Windows &gt; Preferences &gt; MyEclipse Enterprise Workbench &gt; Community Essentials,&nbsp;<br />把选项 "Search for new features on startup"的前勾去掉即可。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">2 关闭updating indexes</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">Window &gt; Preferences &gt; Myeclipse Enterprise Workbench &gt; Maven4Myeclipse &gt; Maven&gt;禁用Download repository index updates on startup 。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">3 关闭MyEclipse的自动validation</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">validation有一堆，什么xml、jsp、jsf、js等等，我们没有必要全部都去自动校验一下，只是需要的时候才会手工校验一下，速度立马提升好几个档次</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">windows &gt; perferences &gt; myeclipse&nbsp;&gt; validation&nbsp;<br />将Build下全部勾取消</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">如果你需要验证某个文件的时候，我们可以单独去验证它。方法是，在需要验证的文件上( 右键 -&gt; MyEclipse -&gt; Run Validation 。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">4 启动优化，关闭不需要使用的模块</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">一个系统20%的功能往往能够满足80%的需求，MyEclipse也不例外，我们在大多数时候只需要20%的系统功能，所以可以将一些不使用的模块禁止 加载启动。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">Window &gt; Preferences &gt; General &gt; Startup andy Shutdown 在这里列出的是MyEclipse启动时加载的模块 我这里只让它加载tomcat5 勾选 MyEclipse EASIE Tomcat 5 。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">怎样才能知道哪些启动项有用呢？我现在把我知道的启动项用处说一下，还有很多不懂的，希望大家懂的回复在下面啊：&nbsp;<br />WTP ：一个跟myeclipse差不多的东西，主要差别是 WTP 是免费的，如果使用myeclipse，这个可以取消&nbsp;<br />Mylyn：组队任务管理工具，类似于 CVS ，以任务为单位管理项目进度，没用到的可以取消&nbsp;<br />Derby：一种保存成 jar 形式的数据库，我没用到，取消&nbsp;<br />一大排以 MyEclipse EASIE 打头的启动项：myeclipse 支持的服务器，只选自己用的，其他取消，比如我只选了tomcat 。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">5 去掉MyEclipse的拼写检查（如果你觉的有用可以不去）</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">拼写检查会给我们带来不少的麻烦，我们的方法命名都会是单词的缩写，他也会提示有错，所以最好去掉，没有多大的用处</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">&nbsp;Window &gt; perferences &gt; General &gt;&nbsp; Editors &gt; Text Editors &gt; Spelling&nbsp;&gt; 将Enable spell checking复选框的勾选去掉。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">6 去掉MyEclipse繁杂的自带插件自动加载项</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br /><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">&nbsp;Window &gt; perferences &gt; General &gt; Startup and Shutdown &gt; 将Plug-ins activated on startup 中的复选框有选择性的勾选去掉。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">7 修改MyEclipse编辑JSP页面时的编辑工具&nbsp;&nbsp;</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br /><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">&nbsp;Window &gt; perferences &gt; General &gt; Editors &gt; File Associations &gt;&nbsp;<br />&nbsp; 在File types 中选择 *.jsp &gt; 在Associated editors 中将"MyEclipse JSP Editor"设置为默认。</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">8 修改MyEclipse安装目录的eclipse.ini文件，加大JVM的非堆内存</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">具体内容如下：<br />&nbsp;-clean<br />&nbsp;-showsplash<br />&nbsp;com.genuitec.myeclipse.product.ide<br />&nbsp;--launcher.XXMaxPermSize<br />&nbsp;256m<br />&nbsp;-vmargs<br />&nbsp;-Xms128m<br />&nbsp;-Xmx512m<br />&nbsp;-Duser.language=en&nbsp;<br />&nbsp;-XX:PermSize=128M&nbsp;<br />&nbsp;-XX:MaxPermSize=256M</span></span></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="font-size: small; padding: 0px; margin: 0px; word-wrap: break-word; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="font-family: &quot;arial black&quot;, &quot;avant garde&quot;;"><span style="font-size: medium;">把下面的那个 -XX:MaxPermSize 调大，比如 -XX:MaxPermSize=512M，再把 -XX:PermSize 调成跟 -XX:MaxPermSize一样大</span></span></p><img src ="http://www.blogjava.net/fanaidehua/aggbug/432613.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/fanaidehua/" target="_blank">蓝胖</a> 2017-06-19 14:43 <a href="http://www.blogjava.net/fanaidehua/archive/2017/06/19/432613.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>an internal error occurred during building workspace错误</title><link>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432612.html</link><dc:creator>蓝胖</dc:creator><author>蓝胖</author><pubDate>Mon, 19 Jun 2017 06:38:00 GMT</pubDate><guid>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432612.html</guid><wfw:comment>http://www.blogjava.net/fanaidehua/comments/432612.html</wfw:comment><comments>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432612.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/fanaidehua/comments/commentRss/432612.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/fanaidehua/services/trackbacks/432612.html</trackback:ping><description><![CDATA[<span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">Eclipse导入了一个比较大的项目，出现了an internal error occurred during building workspace错误。</span><p style="font-size: small; color: #323e32; padding: 0px; margin-top: 0px; word-wrap: normal; line-height: normal; margin-right: 0px; margin-left: 0px; border: 0px; list-style: none; word-break: normal; font-family: simsun; background-color: #528a15;">网上搜了一下，据说是内存溢出问题。可以通过修改<span style="word-wrap: normal; word-break: normal;">eclipse.ini</span>文件解决，</p><p style="font-size: small; color: #323e32; padding: 0px; margin-top: 0px; word-wrap: normal; line-height: normal; margin-right: 0px; margin-left: 0px; border: 0px; list-style: none; word-break: normal; font-family: simsun; background-color: #528a15;">&nbsp;<wbr></p><p style="font-size: small; color: #323e32; padding: 0px; margin-top: 0px; word-wrap: normal; line-height: normal; margin-right: 0px; margin-left: 0px; border: 0px; list-style: none; word-break: normal; font-family: simsun; background-color: #528a15;">优化之后的ini文件内容：</p><p style="font-size: small; color: #323e32; padding: 0px; margin-top: 0px; word-wrap: normal; line-height: normal; margin-right: 0px; margin-left: 0px; border: 0px; list-style: none; word-break: normal; font-family: simsun; background-color: #528a15;"><span style="word-wrap: normal; word-break: normal; line-height: 23px;">-startup<br />plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar<br />--launcher.library<br />plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810<br />-product<br />org.eclipse.epp.package.java.product<br />--launcher.defaultAction<br />openFile<br /><span style="word-wrap: normal; word-break: normal; line-height: 21px; color: #ff6666;">--launcher.XXMaxPermSize<br />256M</span><br />-showsplash<br />org.eclipse.platform<br /><span style="word-wrap: normal; word-break: normal; line-height: 21px; color: #ff0000;">--launcher.XXMaxPermSize<br />256m</span><br />--launcher.defaultAction<br />openFile<br /><br />-vm<br />C:\java\1.6\bin<br /><br />-vmargs<br />-Dosgi.requiredJavaVersion=1.5<br /><span style="word-wrap: normal; word-break: normal; line-height: 21px; color: #ff0000;">-Xms40m<br />-Xmx512m</span></span><br /></p><p style="font-size: small; color: #323e32; padding: 0px; margin-top: 0px; word-wrap: normal; line-height: normal; margin-right: 0px; margin-left: 0px; border: 0px; list-style: none; word-break: normal; font-family: simsun; background-color: #528a15;"><br /></p><p style="font-size: small; color: #323e32; padding: 0px; margin-top: 0px; word-wrap: normal; line-height: normal; margin-right: 0px; margin-left: 0px; border: 0px; list-style: none; word-break: normal; font-family: simsun; background-color: #528a15;">以下为查找得的一些资料，解释我们在修改的参数是什么意思。</p><p style="font-size: small; color: #323e32; padding: 0px; margin-top: 0px; word-wrap: normal; line-height: normal; margin-right: 0px; margin-left: 0px; border: 0px; list-style: none; word-break: normal; font-family: simsun; background-color: #528a15;"><br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>1<strong>.</strong>堆(<span style="word-wrap: normal; word-break: normal; color: #0000ff;">Heap</span>)和非堆(<span style="word-wrap: normal; word-break: normal; color: #0000ff;">Non-heap</span>)内存<br />按照官方的说法：&#8220;Java 虚拟机具有一个堆，堆是运行时数据区域，所有类实例和数组的内存均从此处分配。堆是在 Java 虚拟机启动时创建的。&#8221;&#8220;在JVM中堆之外的内存称为非堆内存(Non-heap memory)&#8221;。可以看出JVM主要管理两种类型的内存：堆和非堆。简单来说堆就是Java代码可及的内存，是留给开发人员使用的；非堆就是JVM留给自己用的，所以方法区、JVM内部处理或优化所需的内存(如JIT编译后的代码缓存)、每个类结构(如运行时常数池、字段和方法数据)以及方法和构造方法的代码都在非堆内存中。</p><p style="font-size: small; color: #323e32; padding: 0px; margin: 0px; word-wrap: normal; line-height: normal; border: 0px; list-style: none; word-break: normal; font-family: simsun; background-color: #528a15;"><strong>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>2.</strong><span style="word-wrap: normal; word-break: normal; color: #0000ff;">堆内存分配<br /></span>&nbsp;<wbr>&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;&nbsp;<wbr>&nbsp;<span style="word-wrap: normal; word-break: normal; color: #ff0000;">JVM初始分配的内存</span>由<span style="word-wrap: normal; word-break: normal; color: #ff0000;">-Xms</span>指定，默认是物理内存的1/64；<span style="word-wrap: normal; word-break: normal; color: #ff0000;">JVM最大分配的内存</span>由<span style="word-wrap: normal; word-break: normal; color: #ff0000;">-Xmx</span>指定，默认是物理内存的1/4。默认空余堆内存小于40%时，JVM就会增大堆直到-Xmx的最大限制；空余堆内存大于70%时，JVM会减少堆直到-Xms的最小限制。因此服务器一般设置-Xms、-Xmx相等以避免在每次GC 后调整堆的大小。</p><p style="font-size: small; color: #323e32; padding: 0px; margin: 0px; word-wrap: normal; line-height: normal; border: 0px; list-style: none; word-break: normal; font-family: simsun; background-color: #528a15;"><strong>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr></strong>3.<span style="word-wrap: normal; word-break: normal; color: #0000ff;">非堆内存分配</span><br />JVM使用-XX:PermSize设置非堆内存初始值，默认是物理内存的1/64；由XX:MaxPermSize设置最大非堆内存的大小，默认是物理内存的1/4。</p><strong style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr></strong><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">4.</span><span style="font-size: medium; line-height: normal; word-wrap: normal; word-break: normal; font-family: simsun; color: #0000ff; background-color: #528a15;">JVM内存限制</span><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">(最大值)</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" /><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">首先JVM内存限制于实际的最大物理内存，假设物理内存无限大的话，JVM内存的最大值跟操作系统有很大的关系。简单的说就32位处理器虽然可控内存空间有4GB,但是具体的操作系统会给一个限制，这个限制一般是2GB-3GB（一般来说Windows系统下为1.5G-2G，Linux系统下为2G-3G），而64bit以上的处理器就不会有限制了。</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" /><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">举例说明含义：</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; word-wrap: normal; word-break: normal; font-family: simsun; color: #ff0000; background-color: #528a15;">&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>-Xms128m 表示JVM Heap(堆内存)最小尺寸128MB，初始分配<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>-Xmx512m 表示JVM Heap(堆内存)最大允许的尺寸256MB，按需分配。</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">说明：如果-Xmx不指定或者指定偏小，应用可能会导致java.lang.OutOfMemory错误，此错误来自JVM不是Throwable的，无法用try...catch捕捉。</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" /><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">PermSize和MaxPermSize指明虚拟机为java永久生成对象（Permanate generation）如，class对象、方法对象这些可反射（reflective）对象分配内存限制，这些内存不包括在Heap（堆内存）区之中。</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">-XX:PermSize=64MB 最小尺寸，初始分配&nbsp;</span><wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">-XX:MaxPermSize=256MB 最大允许分配尺寸，按需分配</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">过小会导致：java.lang.OutOfMemoryError: PermGen space</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">MaxPermSize缺省值和-server -client选项相关。-server选项下默认MaxPermSize为64m</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">-client选项下默认MaxPermSize为32m</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" /><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">PS:</span><span style="font-size: medium; line-height: normal; word-wrap: normal; word-break: normal; font-family: simsun; color: #0000ff; background-color: #528a15;">不同厂家的jdk垃圾回收算法不一样</span><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">。在sun的jdk下，Xms和Xmx设置一样，可以减轻伸缩堆大小带来的压力，但在ibm的jdk下面，设置为一样会增大堆碎片产生的几率。</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" /><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">下面再简单的整理一下</span><span style="font-size: medium; line-height: normal; word-wrap: normal; word-break: normal; font-family: simsun; color: #0000ff; background-color: #528a15;">优化MyEclipse速度</span><span style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">的主要方法：</span><br style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;" />&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;">&nbsp;<wbr style="font-size: medium; line-height: normal; color: #323e32; font-family: simsun; background-color: #528a15;"><span style="font-size: medium; line-height: normal; word-wrap: normal; word-break: normal; font-family: simsun; color: #0000ff; background-color: #528a15;">1.修改myeclipse.ini。<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>2.取消自动validation<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>3.勾掉无用插件。<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>4.修改启动加载模块<br />&nbsp;<wbr style="color: #323e32;"><span style="color: #323e32;">下面附上详细的优化MyEclipse速度方法：（</span><span style="word-wrap: normal; word-break: normal;">转载</span><span style="color: #323e32;">）</span><br style="color: #323e32;" />&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;"><span style="color: #323e32;">http://yufenfei.javaeye.com/blog/376464</span><br style="color: #323e32;" />&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;"><span style="color: #323e32;">http://blog.csdn.net/defonds/archive/2009/07/10/4338782.aspx</span><br style="color: #323e32;" />&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;">&nbsp;<wbr style="color: #323e32;"><span style="color: #323e32;">http://zhangpengshou.javaeye.com/blog/198476</span></span><img src ="http://www.blogjava.net/fanaidehua/aggbug/432612.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/fanaidehua/" target="_blank">蓝胖</a> 2017-06-19 14:38 <a href="http://www.blogjava.net/fanaidehua/archive/2017/06/19/432612.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jsp链接mysql数据库</title><link>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432611.html</link><dc:creator>蓝胖</dc:creator><author>蓝胖</author><pubDate>Mon, 19 Jun 2017 06:33:00 GMT</pubDate><guid>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432611.html</guid><wfw:comment>http://www.blogjava.net/fanaidehua/comments/432611.html</wfw:comment><comments>http://www.blogjava.net/fanaidehua/archive/2017/06/19/432611.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/fanaidehua/comments/commentRss/432611.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/fanaidehua/services/trackbacks/432611.html</trackback:ping><description><![CDATA[<span style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal; background-color: #ffffff;">遇到问题：com.mysql.jdbc.Driver class not found 我在项目中的WEB-INF/lib中添加mysql-connector-java-5.6-bin jar包后在eclipse中选中项目刷新，在lib中选中mysql-connector-java-5.6-bin jar右键点击addbulidPath成功解决问题 完整的代码如下：</span><br style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;" /><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;"><br />&lt;%@page import="java.sql.DriverManager" import="java.sql.Connection" import="java.sql.Statement"&nbsp;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">import="java.sql.ResultSet" %&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;%@ page language="java" contentType="text/html; charset=UTF-8"</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&nbsp; &nbsp; pageEncoding="UTF-8"%&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;html&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;head&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;title&gt;Insert title here&lt;/title&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/head&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;body&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;%</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">Class.forName("com.mysql.jdbc.Driver");</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">Statement stmt=conn.createStatement();</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">String sql="select * from person ";</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">ResultSet rs=stmt.executeQuery(sql);</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">%&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;table bgcolor="green" border="1"&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;tr&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;id&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;name&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;sex&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;age&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/tr&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;%</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">while(rs.next()){</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">%&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;"></div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;tr&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;&lt;%=rs.getString("id") %&gt;&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;&lt;%=rs.getString("name") %&gt;&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;&lt;%=rs.getString("sex") %&gt;&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;td&gt;&lt;%=rs.getString("age")%&gt;&lt;/td&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/tr&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;% }%&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/table&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/body&gt;</div><div style="color: #000066; font-family: verdana, arial, helvetica, sans-serif; font-size: medium; line-height: normal;">&lt;/html&gt;</div><img src ="http://www.blogjava.net/fanaidehua/aggbug/432611.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/fanaidehua/" target="_blank">蓝胖</a> 2017-06-19 14:33 <a href="http://www.blogjava.net/fanaidehua/archive/2017/06/19/432611.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>