I received a very simple class with some folders that compiles like this without problems:
javac -classpath /home/DigestJavaLinux/classes DigestClass.java
In the classes folder i have one .class file called OasisEMSecImp.class
How ever I need to import the class and use its method in another project, the method generates a digest string for the bank to check a transaction, and receives the total and other parameters.
If I add
package digestclass;
to the begining of the class it does not work, i get the error:
digestclass/DigestClass.java:136: cannot find symbol
symbol : class OasisEMSecImp
location: class DigestClass
OasisEMSecImp digest= new OasisEMSecImp();
^
digestclass/DigestClass.java:136: cannot find symbol
symbol : class OasisEMSecImp
location: class DigestClass
OasisEMSecImp digest= new OasisEMSecImp();
^
2 errors
UPDATE: This is the file. It compiles without the package declaration:
package digestclass;
import java.*;
class DigestClass {
private String varMerchant;
private String varStore; // Store ID
private String varTerm; // Term ID
private String varTotal; // Monto de Transaccion
private String varCurrency; // Codigo de Moneda
private String varOrder_id; // Order Id
private String varDigest; // Valor de Digest
public DigestClass(String varMerchant, String varStore, String varTerm,
String varTotal, String varCurrency, String varOrder_id,
String varDigest) {
super();
this.varMerchant = varMerchant;
this.varStore = varStore;
this.varTerm = varTerm;
this.varTotal = varTotal;
this.varCurrency = varCurrency;
this.varOrder_id = varOrder_id;
this.varDigest = varDigest;
}
public String generateDigest(){
OasisEMSecImp digest= new OasisEMSecImp();
varDigest = digest.getDigest(this.varTotal,this.varOrder_id,this.varMerchant,this.varStore,this.varTerm,this.varCurrency);
return varDigest;
}
}
Why ? how to fix this ? Thank you very much for your time.