Package scalaExec.ClassLoaders

Examples of scalaExec.ClassLoaders.ExtensionClassLoader.loadClass()


             int javaNameIdx = javaFile.indexOf(classNameToLoad);
             String pathToAdd = javaFile.substring(0, javaNameIdx-1);   // path to add the the extension class loader class path
             extClassLoader.extendClassPath(pathToAdd)// append the path
                      
           try {   // try to load the class
                        Class  loadedClass = extClassLoader.loadClass(classNameToLoad);
                        Method m = null;
                        // used for invoking the main method of a Java class
                        try {
                            m = loadedClass.getMethod("main", formals);
                        }
View Full Code Here


                    int idx  = currentFile.indexOf(".class");
                    int idxOfBackup = currentFile.indexOf("~")// avoid using backup UNIX style files
                    if (idx != -1 && idxOfBackup==-1)  {  // file is a .class file
                        String  classNameToLoad = currentFile.substring(0, idx);
                        try {
                        Class  loadedClass = extClassLoader.loadClass(classNameToLoad);
                        Method m = null;
                        try {
                            m = loadedClass.getMethod("main", scalaExec.scalaLab.scalaLab.formals);
                        }
                        catch (NoSuchMethodException exc) {
View Full Code Here

             System.out.println("Compilation success for file "+packageName+"."+javaFile);
             int lastPos = javaFile.length()-5// for ".java"
             String  classNameToLoad = javaFile.substring(javaFile.lastIndexOf(File.separatorChar)+1, lastPos);
                      
           try {   // try to load the class
                        Class  loadedClass = extClassLoader.loadClass(classNameToLoad);
                        Method m = null;
                        try {
                            m = loadedClass.getMethod("main", scalaExec.scalaLab.scalaLab.formals);
                        }
                        catch (NoSuchMethodException exc) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.