Merge pull request #6764 from liesheng/BAEL-2889
Bael 2889: Run Jar application with command line arguments
This commit is contained in:
commit
0f6594a1e0
|
@ -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
|
Loading…
Reference in New Issue