Package java.lang

Examples of java.lang.UnsatisfiedLinkError


            String pathSeparator = System.getProperty("path.separator");
            String fileSeparator = System.getProperty("file.separator");
            allPaths = (jlp!=null?jlp:"")+(vblp!=null?pathSeparator+vblp:"")+(udp!=null?pathSeparator+udp:"");

            if (allPaths.length()==0) {
                throw new UnsatisfiedLinkError("Can not find the library: " +
                        libname);
            }

            //String[] paths = allPaths.split(pathSeparator);
            String[] paths;
            {
                ArrayList<String> res = new ArrayList<String>();
                int curPos = 0;
                int l = pathSeparator.length();
                int i = allPaths.indexOf(pathSeparator);
                int in = 0;
                while (i != -1) {
                    String s = allPaths.substring(curPos, i);
                    res.add(s);
                    in++;
                    curPos = i + l;
                    i = allPaths.indexOf(pathSeparator, curPos);
                }

                if (curPos <= allPaths.length()) {
                    String s = allPaths.substring(curPos, allPaths.length());
                    in++;
                    res.add(s);
                }

                paths = (String[]) res.toArray(new String[in]);
            }

            libname = System.mapLibraryName(libname);
            for (int i=0; i<paths.length; i++) {
                if (paths[i]==null) {
                    continue;
                }
                libFullName = paths[i] + fileSeparator + libname;
                try {
                    this.load0(libFullName, cL, false);
                    return;
                } catch (UnsatisfiedLinkError e) {
                }
            }
        } else {
            this.load0(libFullName, cL, false);
            return;
        }
        throw new UnsatisfiedLinkError("Can not find the library: " +
                libname);
    }
View Full Code Here


            String pathSeparator = System.getProperty("path.separator");
            String fileSeparator = System.getProperty("file.separator");
            allPaths = (jlp!=null?jlp:"")+(vblp!=null?pathSeparator+vblp:"")+(udp!=null?pathSeparator+udp:"");

            if (allPaths.length()==0) {
                throw new UnsatisfiedLinkError("Can not find the library: " +
                        libname);
            }

            //String[] paths = allPaths.split(pathSeparator);
            String[] paths;
            {
                ArrayList<String> res = new ArrayList<String>();
                int curPos = 0;
                int l = pathSeparator.length();
                int i = allPaths.indexOf(pathSeparator);
                int in = 0;
                while (i != -1) {
                    String s = allPaths.substring(curPos, i);
                    res.add(s);
                    in++;
                    curPos = i + l;
                    i = allPaths.indexOf(pathSeparator, curPos);
                }

                if (curPos <= allPaths.length()) {
                    String s = allPaths.substring(curPos, allPaths.length());
                    in++;
                    res.add(s);
                }

                paths = (String[]) res.toArray(new String[in]);
            }

            libname = System.mapLibraryName(libname);
            for (int i=0; i<paths.length; i++) {
                if (paths[i]==null) {
                    continue;
                }
                libFullName = paths[i] + fileSeparator + libname;
                try {
                    this.load0(libFullName, cL, false);
                    return;
                } catch (UnsatisfiedLinkError e) {
                }
            }
        } else {
            this.load0(libFullName, cL, false);
            return;
        }
        throw new UnsatisfiedLinkError("Can not find the library: " +
                libname);
    }
View Full Code Here

TOP

Related Classes of java.lang.UnsatisfiedLinkError

Copyright © 2018 www.massapicom. 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.