??xml version="1.0" encoding="utf-8" standalone="yes"?>
http://www.scottdstrader.com/blog/ether_archives/000921.html
Opening a workspace with several projects, I was presented with the following error for two of the projects:
To resolve this error in eclipse do the following steps.
The resolution was to force a resave of the selected projects (and their .classpath files):
Open the project properties
Select Java Build Path > Libraries
Add a new, arbitrary library (to be deleted later) > OK
Wait for the workspace to refresh (or force a refresh of the project)
The error(s) will go away
Remove the dummy library
The only other references I could find were to make minor alterations of contents of the .classpath file.
我们看到其中的AutoActivation Delay默认gؓ(f)200Q单位是毫秒Q也是说在?#8220;.”之后停留200毫秒才能出现感知的提C。那么将它修改ؓ(f)20?x)如何呢Q试一下,修改?0之后提示速度明显上升Q可以达C时俱q啦……:)
okQ上ơ修改了(jin)提示旉。这ơ修改一下它的触发智能感知的触发器。也是让它像我们的 Visual Studio2008那样的强大的感知功能Q即输入S卛_提示出所有以S开头的关键字这L(fng)功能。很单,选项Auto Activation triggers for java的|原有的触发?#8220;.”修改?." + 26×2个字母。嗯Qؓ(f)什么是26×2Q因为字母得分大写呀Q大?6个,写26个,当然?6×2?jin)嘛Q?/p>
具体操作如下Q?/p>
定位刎ͼ(x)Windows→Preferences→Java→Editor→Content Assist
然后修改QAuto Activation triggers for java的默认?#8220;.”?.abc"。接着File→Export→Preferences→导出到某一文gQ假设ؓ(f)test.epf),然后用记事本 打开test.epf,搜烦(ch)".abc"然后其? ?.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW"Q保存?/p>
然后File→Import→Preferences→test.epfQokQ再ȝ写javaE序?/p>
Unbound classpath variable:"a_Tomcat6-depend/ant1.7/ant.jar " in project Tomcat6
弄了(jin)一个早上才意识到错误出现在工程?#8220;.classpath”文g里面
Ҏ(gu)件内容ؓ(f)Q?/p>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="a_Tomcat6-depend/ant1.7/ant.jar"/>
<classpathentry kind="var" path="a_Tomcat6-depend/puretls-0.95/puretls-0.95.jar"/>
<classpathentry kind="var" path="a_Tomcat6-depend/commons/common-logging1.1.1/commons-logging-1.1.1.jar"/>
<classpathentry kind="var" path="a_Tomcat6-depend/jaxrpc1.1/jaxrpc.jar"/>
<classpathentry kind="var" path="a_Tomcat6-depend/jdt3.3/org.eclipse.jdt.core_3.3.0.v_771.jar"/>
<classpathentry kind="var" path="a_Tomcat6-depend/wsdl4j-1.5.1/wsdl4j-1.5.1.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
发现目录里ƈ不存?a_Tomcat6-depend"一文g夹,而实际目录ؓ(f)“Tomcat6/lib/ant1.7/ant.jar”。于? 把该讄改ؓ(f)“lib/ant1.7/ant.jar”Q依然报同类错误。于是很自然地对“.classpath”定义的方式生了(jin)兴趣Q终于找C高 手写的关?#8220;eclipse下环境配|?#8221;的文章?/p>
原来<classpathentry kind="var" path="a_Tomcat6-depend/ant1.7/ant.jar"/>q种定义方式是运用了(jin)eclipse的环境变量,换句话说 a_Tomcat6-depend 应该是一个环境变?make sense!)?/p>
于是 Window->Refernces->Java->Build Path->Classpath Variables
定义?jin)一个name为a_Tomcat6-depend
Then,Done.
eclipse中需要关联到W三方JAR文g?可以直接dJAR文g,也可以增加环境变量的形式来添加JAR文g,当然原理都是一L(fng),都是引用
JAR文g,除了(jin)可以直接右点dE?属??Java Build Path"中添加外,其实q可以直接编辑工E目录下?
.classpathq个文g,q个文gx(chng)记录工程中的一些环境变量及(qing)工程中文件的输出目的?此文件结构大臛_?
No.1:
今天在测试Eclipse+Tomcat写的应用E序的时候出C(jin)q样警告Q?/span>
2008-10-11 21:33:55 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告 : [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TestTomcat6.0.16' did not find a matching property.
2008-10-11 21:33:55 org.apache.catalina.core.AprLifecycleListener init
信息 : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:"study tools"Java"jdk1.5.0_06"bin;.;C:"WINDOWS"system32;C:"WINDOWS;D:/study tools/Java/jdk1.5.0_06/bin/../jre/bin/client;D:/study tools/Java/jdk1.5.0_06/bin/../jre/bin;D:"study tools"Borland"Delphi7"Bin;D:"study tools"Borland"Delphi7"Projects"Bpl";D:"study tools"Java"jdk1.5.0_06"bin;C:"WINDOWS"system32;C:"WINDOWS;C:"WINDOWS"System32"Wbem;D:"study tools"MySQL"MySQL Server 5.0"bin;C:"Program Files"Microsoft SQL Server"80"Tools"BINN
出现SetPropertiesRule 警告的原因是因ؓ(f)Tomcat 在server.xml 的Context 节点中不支持source 属性:(x) <Context docBase="…" path="/…" source="org.eclipse.jst.j2ee.server:…"/>
解决Ҏ(gu)是在Servers 视图里双d建的server Q然后在其server 的配|界面中选中"Publish module contexts to separate XML files" 选项。如下图Q?/span>
不过Q不知道q样做的具体意义是什么,因ؓ(f)即出现q个WarningQ程序也正常执行?/span>
NO2:
q有一个错误信息是Q?/span>
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
q个具体信息参考:(x)Apache Tomcat Native library
解决Ҏ(gu)是:(x)http://tomcat.heanet.ie/native/ 下蝲你需要的版本的tcnative-1.dll攑օSystem32下面或者放在Tomcat 的bin目录下即可?/span>
NO3Q?/span>
q个跟Mysql有关Q就是在插入Datecd数据时候,Java改如何写插入语句Q?/span>
NO4,:
今天用javamail做了(jin)一个发送邮件的功能.遇到?jin)一pd的问?
1:在本?windows环境)试一切正?上传到服务器(Linux环境)出?jin)问?[java.lang.SecurityException: Access to default session denied ],也就是获得默认的session时无法获?郁闷?jin)N?在网上搜?jin)?有朋友遇到同L(fng)问题,但都没hl予解决Ҏ(gu),我在csdn,javaeye发帖也没人回.后来在又看了(jin)一朋友的blog,他写的解军_法是, ? mailSession = Session.getDefaultInstance(props,sa);Ҏ(gu)mailSession = Session.getInstance(props,sa); 是新创Z个session,我试?jin)?可以解决问题Q但q是扑ֈZ么不能获取默认session的原?而且担心(j)q样没次都Session.getInstance(props,sa);?x)不会(x)出问?
2.发送email内容为html?出现q.同样是在本地试正常,传到服务器上出问题.后来l过试,发现是服务器默认~码的问?服务? 的默认编码UTF-8,我的email内容是本Chtml文g,在读取文件内Ҏ(gu)没有讄~码,所以读取出来的已l是q?.后来该成 FileInputStream fis = new FileInputStream(filename);BufferedReader in = new BufferedReader(new InputStreamReader(fis,"GBK"));O(jin)K? InputStreamReader不指定编码方式的话将采用底层操作pȝ的默认编码方?所以这里要在构造器重指定编码的方式.
3.static变量的问? 我定义了(jin)一个静(rn)态类变量public static boolean isRunning = false;来判断状?刚开始一切正?但是在一ơ出?jin)异怹?无法执行了(jin),有让我郁闷了(jin)好大一?后来才发?是static的原?( static变量属于cd量,在这个类的所?new出来的对象中只存在一个该变量Q每个对象是对同一变量q行操作Qstatic的变量和初始化块仅仅q行一ơ。不象没有static的变量,每次new的时候,都会(x)重新初始?/span> ?因ؓ(f)static变量只初始化一?之后使用的值都是之前的状态?所以我的问题就出在当运行正常时,q行时会(x)把状态改为true,l束后会(x)把状态改为false.但是出现异常?后面没把状态改成false.所以下ơ执行时无法往下执行了(jin). from:http://hi.baidu.com/xublog/blog/item/7f7d5bfc8f356381b901a0e7.html以前安装Eclipse插g无非两种方式, 直接copy插g到features/plugins目录或者在links目录下创建链接文? 刚刚发布的Eclipse 3.4又推出另一U新的安装途径, UCؓ(f)provisioning platform(p2), 更加灉|.
Eclipse 3.4下有个dropins目录, 只要把插件放到该目录下就可以加蝲, 有几U格式可以选择.
1. 最单的:
eclipse/dropins/
org.eclipse.core.tools_1.4.0.200710121455.jar
org.eclipse.releng.tools_3.3.0.v20070412/
plugin.xml
tools.jar
... etc ...
...
2. 传统格式:
eclipse/dropins/eclipse/features/
eclipse/dropins/eclipse/plugins/
3. 按照插g名称区分:
eclipse/dropins/emf/eclipse/features/
eclipse/dropins/emf/eclipse/plugins/
eclipse/dropins/gef/eclipse/features/
eclipse/dropins/gef/eclipse/plugins/
... etc ...
4. cMlinks方式d链接:
eclipse/dropins/emf.link
以上几种可以Ҏ(gu)个h喜欢随意选择.