I have java class which I'm doing file copy to another directory. I want to call it in javascript. I wrote something like this.
                 for(var i=0;i<arrayExtensions.length;i++){
                        if(arrayExtensions[i]==value.extType){
                            var x=new Package.org.solr.copyImages();
                            var y=x.main(value.FileName,value.FilePath);
                            document.getElementById(showImages).src=y;
                            $(this).find("#showImages").fadeIn();
                        }
                        else{
                            $(this).find("#showImages").fadeOut();
                        }
But when I run my project it gives me this error in console.
Uncaught ReferenceError: Package is not defined
    at HTMLAnchorElement.<anonymous> (index.jsp:216)
    at HTMLDocument.dispatch (jquery-1.12.4.js:5226)
    at HTMLDocument.elemData.handle (jquery-1.12.4.js:4878)
My java codes like this
public static String main(String name,String path) {
        // TODO Auto-generated method stub
        File original=new File(path);
        File dest=new File("T:\\Temp\\");
        try {
            FileUtils.copyFileToDirectory(original, dest);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        String newPath="T:\\Temp\\"+name;
        return newPath;
    }
What am I doing wrong?
 
    