In a folder ~/tmp/tmp1 create 2 files:
Sources
cli.java:
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.6.3
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Parameters;
import java.util.concurrent.Callable;
@Command(name = "cli", mixinStandardHelpOptions = true, version = "cli 0.1",
description = "cli made with jbang")
class cli implements Callable<Integer> {
@Parameters(index = "0", description = "The greeting to print", defaultValue = "World!")
private String greeting;
public static void main(String... args) {
int exitCode = new CommandLine(new cli()).execute(args);
System.exit(exitCode);
}
@Override
public Integer call() throws Exception { // your business logic goes here...
System.out.println("Hello " + greeting);
return 0;
}
}
log.java:
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS ch.qos.reload4j:reload4j:1.2.19
import static java.lang.System.out;
import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;
import java.util.Arrays;
class log {
static final Logger logger = Logger.getLogger(log.class);
public static void main(String[] args) {
BasicConfigurator.configure();
logger.info("Welcome to jbang");
Arrays.asList(args).forEach(arg -> logger.warn("arg: " + arg));
logger.info("Hello from Java!");
}
}
Import the cli.java script as Jbang project into Eclipse.
- Both scripts appears in the
cli.java project.
- The dependencies are only resolved for the
cli.java file

In a folder
~/tmp/tmp1create 2 files:cli.javalog.javaSources
cli.java:
log.java:
Import the
cli.javascript as Jbang project into Eclipse.cli.javaproject.cli.javafile