Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » ant jdt batch compiler problem - no uniform encoding(jdt compile no uniform encoding sources)
ant jdt batch compiler problem - no uniform encoding [message #1776650] Mon, 20 November 2017 02:02 Go to next message
feng lin is currently offline feng linFriend
Messages: 1
Registered: November 2017
Junior Member
I have use the ant invoke the jdt batch compiler in my project. But there are some nouniform encoding files with it. so i need to add the specified encoding in each file. There are some problems in it.It shows below:

the ant file:

<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdatper" />
<property name="compiler.args" value="-encoding UTF-8 src/Zz.java[GBK]" />

<javac destdir="${bin.dir}" includeantruntime="true" debug="true" fork="true" failonerror="true">
   <compilearg line="${compiler.args}" />
   <src path="${src.dir}"/>
   <classpath refid="compile.classpath" />
</javac>


executing this task, it show errors:

public class Zz {
The type Zz is already defined.


How can i use the encoding flag to compile nouniform files.

The home document is https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-ant_javac_adapter.htm

Re: ant jdt batch compiler problem - no uniform encoding [message #1777285 is a reply to message #1776650] Tue, 28 November 2017 07:22 Go to previous message
Jay Arthanareeswaran is currently offline Jay ArthanareeswaranFriend
Messages: 15
Registered: July 2009
Junior Member
Did you try the "encoding" attribute of Javac task, like the below example:

<javac destdir="${bin.dir}" includeantruntime="true"  encoding="UTF-8">


Also, there's a typo in the compiler adapter name "JDTCompilerAdatper".
Previous Topic:java.lang.ClassNotFoundException with java9 and maven
Next Topic:What's the difference between getResource and getUnderlyingResource in IJavaElement
Goto Forum:
  


Current Time: Fri Dec 15 18:12:25 GMT 2017

Powered by FUDForum. Page generated in 0.02244 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software