What may confuse you is that the gremlin console does a lot of under the hood imports, but it doesn't import all janusgraph classes. So, you can solve this in two ways:
Preferred: rather use the underlying interface for specifiying the type, so line 3 private Graph graph;
Optional: do an explicit import of StandardJanusGraph
gremlin> StandardJanusGraph No such property: StandardJanusGraph for class: groovysh_evaluate Type ':help' or ':h' for help. Display stack trace? [yN]n gremlin> Graph ==>interface org.apache.tinkerpop.gremlin.structure.Graph