Merge pull request #6764 from liesheng/BAEL-2889

Bael 2889: Run Jar application with command line arguments
This commit is contained in:
Eric Martin
2019-05-03 20:39:48 -05:00
committed by GitHub
3 changed files with 44 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
*.class
0.*
#folders#
/target
/neoDb*
/data
/src/main/webapp/WEB-INF/classes
*/META-INF/*
.resourceCache
# Packaged files #
*.jar
*.war
*.ear
# Files generated by integration tests
backup-pom.xml
/bin/
/temp
#IntelliJ specific
.idea/
*.iml
@@ -0,0 +1,18 @@
package com.baeldung.jarArguments;
public class JarExample {
public static void main(String[] args) {
System.out.println("Hello Baeldung Reader in JarExample!");
if(args == null) {
System.out.println("You have not provided any arguments!");
}else {
System.out.println("There are "+args.length+" argument(s)!");
for(int i=0; i<args.length; i++) {
System.out.println("Argument("+(i+1)+"):" + args[i]);
}
}
}
}
@@ -0,0 +1 @@
Main-Class: com.baeldung.jarArguments.JarExample