Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Library in code folder doesn't work properly

$
0
0

I made this little library: GitHub

I have put the Maven build of this library into my code folder, and tried this:

import iliquid.exjs.*;

exJS js;

void setup() {
  js = new exJS();
  noLoop();
}

void draw() {
  js.loadScript(sketchPath() + "/data/script.js");
  js.addImport("java.lang.System", "system");
  js.initEngine();
  js.evalScript();
}

But I am getting errors like:

The function "loadScript(String)" doesn't exist

even though the function clearly exists in my library's code:

public void loadScript(String path) {
    try {
        script = new BufferedReader(new FileReader(path));
    } catch (FileNotFoundException e) {
        System.err.printf("(exJS) Error: Could not load script from file %s%n", path);
        e.printStackTrace();
    }
}

You might suggest that I should use the Eclipse Library Template. I don't want to, because I use IntelliJ (although it has an Eclipse project import feature, but this didn't happen with a previous library of mine, which was developed without the template like this one.)

What could be the cause of my problem?


Viewing all articles
Browse latest Browse all 2896

Trending Articles