We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In a folder ~/tmp/tmp1 create 2 files:
~/tmp/tmp1
cli.java
log.java
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.
The text was updated successfully, but these errors were encountered:
For me this is related to how the resource is linked into the project.
In the .project file:
.project
<linkedResources> <link> <name>src</name> <type>2</type> <location>/home/jbr/tmp/tmp1</location> </link> </linkedResources>
The folder containing the file is linked.
For me it would be more correct to link only a specific file:
<linkedResources> <link> <name>src/cli.java</name> <type>1</type> <location>/home/jbr/tmp/tmp1/cli.java</location> </link> </linkedResources>
Often I have a jbang script in a non-empty folder (like at the root of a git repo where there is plenty of other projects).
For me the idea to import a Jbang script a a dedicated Eclipse project is to work only on that script.
Sorry, something went wrong.
It used to work like that (1 project / script) but I must have somehow broken it in Eclipse when implementing 1 project / folder
No branches or pull requests
In a folder
~/tmp/tmp1
create 2 files:cli.java
log.java
Sources
cli.java:
log.java:
Import the
cli.java
script as Jbang project into Eclipse.cli.java
project.cli.java
fileThe text was updated successfully, but these errors were encountered: