Web項目lib下的jar包無法自動加載


Web項目復制到lib下的jar包不自動加載

打開項目的Java source目錄,發現沒有web app libraries目錄

 

解決:

打開項目源碼,打開.classpath文件,內容如下

<classpath>

            <classpathentrykind="src" path="src"/>

            <classpathentrykind="con"path="melibrary.com.genuitec.eclipse.j2eedt.core.MYECLIPSE_JAVAEE_5_CONTAINER"/>

<classpathentry kind="con"path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">

                       <attributes>

                                   <attributename="owner.project.facets" value="java"/>

                       </attributes>

            </classpathentry>

            <classpathentrykind="output" path="WebRoot/WEB-INF/classes"/>

</classpath>

對比可以自動加載的項目的.classpath文件

<classpath>

            <classpathentrykind="src" path="src"/>

            <classpathentrykind="con" path="com.genuitec.eclipse.j2eedt.core.J2EE14_CONTAINER"/>

            <classpathentrykind="con" path="org.eclipse.jdt.USER_LIBRARY/MyJars"/>

            <classpathentrykind="con"path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">

                        <attributes>

                                   <attributename="owner.project.facets" value="java"/>

                       </attributes>

             </classpathentry>

<classpathentrykind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>

<classpathentrykind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>

          <classpathentrykind="output" path="WebRoot/WEB-INF/classes"/>

</classpath>

 

添加這一句:<classpathentry kind="con"path="org.eclipse.jst.j2ee.internal.web.container"/>   重啟eclipse即可

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM