標籤:des style color java 使用 os io strong
將Intellij Idea建立的web項目轉換為MyEclipse版本的web項目,主要建立如下檔案,並修改其中的內容:
一、.project檔案(注意前面的·)
<span style="color:#888888;"><?xml version=”1.0″ encoding=”UTF-8″?><projectDescription></span><span style="color:#ff0000;"><name>Test</name></span><span style="color:#888888;"><comment></comment><projects></projects><buildSpec><buildCommand><name>org.eclipse.wst.common.project.facet.core.builder</name><arguments></arguments></buildCommand><buildCommand><name>org.eclipse.wst.jsdt.core.javascriptValidator</name><arguments></arguments></buildCommand><buildCommand><name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name><arguments></arguments></buildCommand><buildCommand><name>org.eclipse.jdt.core.javabuilder</name><arguments></arguments></buildCommand><buildCommand><name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name><arguments></arguments></buildCommand><buildCommand><name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name><arguments></arguments></buildCommand><buildCommand><name>org.eclipse.wst.validation.validationbuilder</name><arguments></arguments></buildCommand><buildCommand><name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name><arguments></arguments></buildCommand></buildSpec><natures><nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature><nature>org.eclipse.jem.workbench.JavaEMFNature</nature><nature>com.genuitec.eclipse.j2eedt.core.webnature</nature><nature>org.eclipse.jdt.core.javanature</nature><nature>org.eclipse.wst.jsdt.core.jsNature</nature><nature>org.eclipse.wst.common.project.facet.core.nature</nature><nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature></natures></projectDescription></span>
主要修改的是name,將name修改為你具體工程的名稱。
二、.classpath
<span style="color:#888888;"><?xml version=”1.0″ encoding=”UTF-8″?><classpath></span><span style="color:#ff0000;"><classpathentry kind=”src” path=”src”/></span><span style="color:#888888;"><classpathentry kind=”con” path=”org.eclipse.jdt.launching.JRE_CONTAINER”/><classpathentry kind=”con” path=”melibrary.com.genuitec.eclipse.j2eedt.core.MYECLIPSE_JAVAEE_6_CONTAINER”/><classpathentry kind=”con” path=”org.eclipse.jst.j2ee.internal.web.container”/><classpathentry kind=”con” path=”org.eclipse.jst.j2ee.internal.module.container”/></span><span style="color:#ff0000;"><classpathentry kind=”output” path=”web/WEB-INF/classes”/></span><span style="color:#888888;"></classpath></span>
主要修改的是src屬性和output屬性,修改為你工程具體的路徑,例如,本人的web元素是放在web下的,MyEclipse建立的工程預設是放在WebRoot目錄下的
三、.mymetadata
<span style="color:#888888;"><?xml version=”1.0″ encoding=”UTF-8″?><project-module</span><span style="color:#ff0000;"> type=”WEB”</span><span style="color:#888888;"></span><span style="color:#ff0000;"> name=”Test”</span><span style="color:#888888;"> id=”myeclipse.1407308101935″</span><span style="color:#ff0000;"> context-root=”/Test”</span><span style="color:#888888;"> j2ee-spec=”6.0″</span><span style="color:#ff0000;"> archive=”Test.war”></span><span style="color:#888888;"> <attributes> </span><span style="color:#ff0000;"> <attribute name=”webrootdir” value=”web” /></span><span style="color:#888888;"> </attributes></project-module></span>
修改具體對應的項目名稱為你工程對應的
四、建立目錄.settings
在該目錄下主要建立如下6個檔案:
(1) org.eclipse.core.resources.prefs
#Wed Aug 06 15:01:06 CST 2014eclipse.preferences.version=1encoding/<project>=UTF-8
(2)
org.eclipse.jdt.core.prefs
#Wed Aug 06 14:55:08 CST 2014eclipse.preferences.version=1org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabledorg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6org.eclipse.jdt.core.compiler.compliance=1.6org.eclipse.jdt.core.compiler.problem.assertIdentifier=errororg.eclipse.jdt.core.compiler.problem.enumIdentifier=errororg.eclipse.jdt.core.compiler.source=1.6
(3) org.eclipse.wst.common.component
<span style="color:#888888;"><?xml version=”1.0″ encoding=”UTF-8″?><project-modules id=”moduleCoreId” project-version=”1.5.0″> </span><span style="color:#ff0000;"><wb-module deploy-name=”Test”></span><span style="color:#888888;"> </span><span style="color:#ff0000;"><wb-resource deploy-path=”/” source-path=”/web”/></span><span style="color:#888888;"> </span><span style="color:#ff0000;"><wb-resource deploy-path=”/WEB-INF/classes” source-path=”/src”/></span><span style="color:#888888;"> </span><span style="color:#ff0000;"> <property name=”context-root” value=”/Test”/></span><span style="color:#888888;"> </span><span style="color:#ff0000;"><property name=”java-output-path” value=”/Test/web/WEB-INF/classes”/></span><span style="color:#888888;"> </wb-module></project-modules></span>
修改每個路徑為你工程目錄對應的路徑
(4) org.eclipse.wst.common.project.facet.core.xml
<?xml version=”1.0″ encoding=”UTF-8″?><faceted-project> <fixed facet=”wst.jsdt.web”/> <installed facet=”java” version=”1.6″/> <installed facet=”jst.web” version=”3.0″/> <installed facet=”wst.jsdt.web” version=”1.0″/></faceted-project>
(5)
org.eclipse.wst.jsdt.ui.superType.container
空目錄,建立這個檔案即可;
(6) org.eclipse.wst.jsdt.ui.superType.name
空目錄,建立這個檔案即可。
執行完上述步驟之後,就可以使用MyEclipse的import選項匯入進去了。