add test code for running jar with arguments

This commit is contained in:
Liesheng Long 2019-04-20 23:08:06 -04:00
parent 48b5417f75
commit b787689731
3 changed files with 44 additions and 0 deletions

25
core-java-8-2/.gitignore vendored Normal file
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

View File

@ -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]);
}
}
}
}

View File

@ -0,0 +1 @@
Main-Class: com.baeldung.jarArguments.JarExample