If you're hoping to execute lines of java source code on the fly...then forget it. Java is a compiled language. It doesn't have an "eval" statement like other languages.
Now, you can write an interpreter for a language in Java. And I suppose you could write an interpreter for Java in Java (although at that point, you might as well choose to interpret a different language; it would probably be easier). But that would be a pretty big task.
beanshell has a libaray that you can use in your Java code. You can pass Java statements (well, probably beanshell statements, which would be a superset--or nearly one--of Java statements) to be executed.
The "interface" you speak of--by which I assume you mean the interactive interpreter--is just a Java program that uses that API.