Symptoms:
Using the ant packaged jar, the variable becomes the following meaningless arg0,arg1. The code hints are the same. Using Eclipse's export jar is no problem
Workaround:
Let ant use the packaging capabilities of Eclipse.
1. Add debug= "True" debuglevel= "lines, VARs, source" in Build.xml's Javac command for the two line properties
2. Add <property name= "Build.compiler" value= "Org.eclipse.jdt.core.JDTCompilerAdapter" in Build.xml head ></ Property>
(Prevent class not found:org.eclipse.jdt.core.JDTCompilerAdapter problems)
3. Copy the Org.eclipse.jdt.core.jar and Jdtcompileradapter.jar into the Ant's Lib directory. (two files can be found in the installation directory of Eclipse, if not enough or lazy, click here to download.) At the end of this article, all-inclusive downloads are available, and if you have questions, you can download the full package.
Rerun the Build.xml file and the resulting jar will see the effect.
Explain:
- The problem is that the ant package default Javac command is Debug=false.
- When Debug opens, the jar package will be larger than the original package (my original 250K package, opened after debug to 320K, One-third larger)
- If you just keep the variable name, you can abbreviate the debuglevel= "VARs" so that the jar package becomes smaller. (I've got a 320K bag here, it's 280K)
- Debuglevel= the parameters of "lines, VARs, source" are described below
Lines: Writes the line number information from the source file to the class file, which is used to generate a mapping between the method byte stream offset and the source code line number in the class file. If this property is not specified, the printed line number is not visible in the stack exception information.
The Vars:local variable property establishes a mapping between the local variables part of the stack frame of the method and the local variable name and descriptor in the source code. With this property, when debugging, we can see the value of the variable.
Source: This property is specified at compile time, which writes the source file's property information, such as the source file name, to the class file
Download the required resources:
http://download.csdn.net/detail/landehuxi/8357897
Ant package jar, parameter name becomes meaningless Arg0,arg1,java code hint argument name meaningless