This is a pretty simple question but I can't work it out so I hope you'll bear with me. I'm running IntelliJ on Windows and I'm using it as a Clojure IDE. I'm trying to invoke my core.clj by running RT.loadResourceScript but I cannot figure out the correct path for my core.clj. I'm new to IntelliJ, having worked with Leiningen on Linux before this.
The project is under C:\Users\L\IdeaProjects\LearningClojure The core.clj and Driver.java files are located in the src folder.
I have tried using "src/core.clj" "core.clj" "src\core.clj" and variations going as far up the tree as "LearningClojure" for my CLJ variable.
My Driver.java file is as follows
import clojure.lang.RT;
public class Driver
{
private static final String CLJ = "src/core.clj";
public static void main( String[] args)
{
try
{
RT.loadResourceScript(CLJ);
RT.var("learning", "main").invoke(args);
}
catch(Exception E)
{
E.printStackTrace();
}
finally
{
System.out.println("End of Execution");
}
}
}
Output returns
End of Execution
java.io.FileNotFoundException: Could not locate Clojure resource on classpath: src/core.clj
at clojure.lang.RT.loadResourceScript(RT.java:366)
at clojure.lang.RT.loadResourceScript(RT.java:346)
at clojure.lang.RT.loadResourceScript(RT.java:338)
at Driver.main(Driver.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Process finished with exit code 0
On a somewhat related note does anyone have a link to a good explanation of Java packages and how they correspond to classpaths and directory layouts when dealing with IDE project layouts?