Import class into java script (javax.script)

I want to import the class that I created in my project into my script I did this, but it does not work:

    function doFunction(){
 //Objectif Mensuel
 importPackage(java.lang);
 importClass(KPDataModel.KPData.KPItem); //ERROR HERE, this is my class that I want to import

 KPItem kpItem = kpItemList.get(0);
 System.out.println(kpItem.CellList.get(2).Value);
 System.out.println("-------");
 var proposedMediationSum = Integer.parseInt(kpItemList.get(0).CellList.get(2).Value);
 var refusedMediationSum = Integer.parseInt(kpItemList.get(0).CellList.get(3).Value)
 var totalMediation = proposedMediationSum + refusedMediationSum;

 kpItemList.get(0).CellList.get(4).Value = totalMediation;

}
+5
source share
1 answer

Well, thnx a lot, I found that the problem comes from import. This is what he said on the Oracle website:

Packages Java. : Packages.java.util.Vector, Packages.javax.swing.JFrame. , "java" "Packages.java". javax, org, edu, com, , JDK "".

, : importClass (Packages.KPDataModel.KPData.KPItem);

+4

All Articles