Java imports in Lucee 6

I love the potential of the new java integration in Lucee 6. I’ve always struggled getting java libraries integrated into my CF code, usually around translating import statements into object instantiation to satisfy dependencies. With support being added for java methods in components, how do I handle this?

Maybe I’m asking the question awkwardly, but here’s a simple example. Implementing JGit, am I doing this in my component constructor?

var git = createObject( "java", "org.eclipse.jgit.api.Git" ).init(db);

or is having the jar active enough to just do it this way in the java function?

Git git = new Git(db);