我们无法根据蚂蚁编译,但工作在命令行,为什么呢? [英] Unable to compile from ant but works from the command line, why?
问题描述
林有麻烦提供一个类来我的项目,在这两个蚂蚁和月食。
Im having trouble making a class available to my project, in both ant and eclipse.
我使用eclipse JUNO + WPT 和蚂蚁1.7
I'm using eclipse juno+wpt, and ant 1.7.
我从信用卡公司名为CrediCard在委内瑞拉已经工作网站的整合支付plataform。
I'm integrating a payment plataform from a credit card company called CrediCard in Venezuela to an already working site.
我们收到的.zip包,其中包含以下内容:
We received a .zip package which contains the following:
林:
libc6.1-1.so.2
项目所需的运行,这我不真正了解。
也因为生产OS自身也未Debian的。
Needed for the project to run, which i dont really understand. Also because the production OS its also un debian.
包有一个名为ejemplodigest.java,与指令源的例子来编译它是这样的:
The package has a source example called ejemplodigest.java, with the instructions to compile it like this:
javac -classpath /home/DigestJavaLinux/classes ejemplodigest.java
和这样运行的:
java -Djava.library.path=/home/DigestJavaLinux/lib/ -classpath /home/DigestJavaLinux/:/home/DigestJavaLinux/classes ejemplodigest
这些命令在命令行上完美运行。要运行它依赖的 libc6.1-1.so.2 必须安装在debian的。
These commands run perfectly on the command line. To run it the dependency libc6.1-1.so.2 must be installed in debian.
如何过即时通讯无法连编译code。与蚂蚁,当我在自己的项目对应的线和类路径添加到Ant的javac任务。我得到的错误
How ever im not able to even compile the code with ant, when i include the corresponding lines in my project and add the classpath to the ant's javac task. I get the error
symbol : class OasisEMSecIm
[javac] location: class com.bamboo.catW3.business.impl.MainHtmlController
[javac] OasisEMSecIm digest= new OasisEMSecImp();
在类的声明,进口:
import OasisEM.*;
import eMerchantServlet.*;
都没有发现:
OasisEM does not exist.
这是给出的示例源:
//import OasisEM.*;
import java.*;
// import eMerchantServlet.*;
class ejemplodigest {
public static void main(String args[]) {
String varMerchant = "00260364"; // Merchant ID
String varStore = "0"; // Store ID
String varTerm = "4001"; // Term ID
String varTotal = "12345445"; // Monto de Transaccion
String varCurrency = "937"; // Codigo de Moneda
String varOrder_id = "444444"; // Order Id
String varDigest; // Valor de Digest
OasisEMSecImp digest= new OasisEMSecImp();
varDigest = digest.getDigest(varTotal,varOrder_id,varMerchant,varStore,varTerm,varCurrency);
System.out.println ("Merchant ID :" + varMerchant);
System.out.println ("Store ID :" + varStore);
System.out.println ("Term ID :" + varTerm);
System.out.println ("Total :" + varTotal);
System.out.println ("Currency :" + varCurrency);
System.out.println ("Order ID :" + varOrder_id);
System.out.println ("Digest " + varDigest);
}
}
我不能够让Eclipse中承认他们要么,我曾尝试添加类文件夹到Eclipse,使得该类一个罐子,加入它。
I'm not able to make Eclipse recognise them either, i have tried adding the class folder to the Eclipse, making the class a jar and adding it.
我查了一下路径由Ant任务正确地接收,与所有其他依赖它做工精细。
I checked and the paths are correctly received by the ant task, with all the others dependencies which work fine.
ANT问:为什么示例源使用命令行编译,但添加相同的线路时,在我的项目的方法和添加类路径的类文件夹不编译
ANT Question: Why does the example source compiles with the command line, but when adding the same lines to a method in my project and adding the classpath to the class folder it does not compile ?
Eclipse的问题:我如何可以使Eclipse的识别类OasisEMSecImp
Eclipse Question: How can i make Eclipse recognise the class OasisEMSecImp ?
更新
您好,蚂蚁的文件是有点长,怎么过我会贴上我认为是相关的部分:
Hello, the ant file is a little long, how ever i'll paste what i think is the relevant part:
<path id="library.digest.classpath">
<pathelement location="../../digest/classes"/>
</path>
<path id="catw.module.classpath">
<path refid="library.blazeds.classpath"/>
<path refid="library.hibernate3.classpath"/>
<path refid="library.jta.classpath"/>
<path refid="library.log4j.classpath"/>
<path refid="library.mail.classpath"/>
<path refid="library.oreilly.classpath"/>
<path refid="library.spring-2.0.7.classpath"/>
<path refid="library.velocity.classpath"/>
<path refid="library.jexcel.classpath"/>
<path refid="library.tomcat_5.classpath"/>
<path refid="library.digest.classpath" />
<pathelement location="../catw-common/build/catw-common.jar"/>
</path>
<javac destdir="${catw.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
<compilerarg line="${compiler.args.catw}"/>
<bootclasspath refid="catw.module.bootclasspath"/>
<classpath refid="catw.module.classpath"/>
<src refid="catw.module.sourcepath"/>
<patternset refid="excluded.from.compilation.catw"/>
</javac>
我调试的catw.module.classpath和位置是否正确。
I debugged the catw.module.classpath and the location is correct.
非常感谢你在前进。
推荐答案
我已经明白这个问题,发现周围的工作我的情况,我解释一下我的<一个href=\"http://stackoverflow.com/questions/15576305/unable-to-create-jar-when-adding-the-package-declaration\">answer在这个问题上。
I have understood the problem and found a work around for my situation, i explain it in my answer in this question.
希望它可以帮助别人。
这篇关于我们无法根据蚂蚁编译,但工作在命令行,为什么呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!