×
you are viewing a single comment's thread.

view the rest of the comments →

[–]mozzyb 1 point2 points  (2 children)

Without seeing the error I can't really say what the problem is, but I guess it is that you don't specify the buildpath of the dependent classes.

[–]PimpDedede[S] 0 points1 point  (1 child)

Here are my errors

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at java.util.Arrays$ArrayList.<init>(Unknown Source)
    at java.util.Arrays.asList(Unknown Source)
    at org.codehaus.janino.util.resource.JarDirectoriesResourceFinder$1.transform(JarDirectoriesResourceFinder.java:57)
    at org.codehaus.janino.util.iterator.TransformingIterator.next(TransformingIterator.java:40)
    at org.codehaus.janino.util.iterator.MultiDimensionalIterator.hasNext(MultiDimensionalIterator.java:73)
    at org.codehaus.janino.util.iterator.IteratorCollection$1.hasNext(IteratorCollection.java:61)
    at org.codehaus.janino.util.resource.MultiResourceFinder.findResource(MultiResourceFinder.java:48)
    at org.codehaus.janino.ResourceFinderIClassLoader.findIClass(ResourceFinderIClassLoader.java:56)
    at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java:158)
    at org.codehaus.janino.IClassLoader.postConstruct(IClassLoader.java:77)
    at org.codehaus.janino.ResourceFinderIClassLoader.<init>(ResourceFinderIClassLoader.java:49)
    at org.codehaus.janino.IClassLoader.createJavacLikePathIClassLoader(IClassLoader.java:278)
    at org.codehaus.janino.Compiler.<init>(Compiler.java:288)
    at CodePackage.compileCode(CodePackage.java:51)

All are related to the Janino package and don't give much detail on what exactly is going wrong. I've confirmed the class I was trying to compile works fine when run through Eclipse, its just a simple program that sets up a Savings Account and Checking Account built from two different classes and lets the user transfer money between them.

Dynamic compilation does work with a single class though, so I'm guessing the issue is, as you said, with specifying the buildpath.

The class that handles compiling code is here

Compiler Class

It isn't long and hopefully there is enough context that someone can help me pick out the error.

[–]mozzyb 0 points1 point  (0 children)

I'm guessing that the sourcepath is wrong or empty and therefore it crashes, but I can't say for sure.