Why not ?
Just modify your Main-Class
to receive arguments and act upon the argument.
public class wiki2txt {
public static void main(String[] args) {
String fileName = args[0];
// Use FileInputStream, BufferedReader etc here.
}
}
Specify the full path in the commandline.
java -jar wiki2txt /home/bla/enwiki-....xml
Related Contents:
- How to get the path of a running JAR file?
- How to list the files inside a JAR file?
- Including jars in classpath on commandline (javac or apt)
- Eclipse exported Runnable JAR not showing images
- How to run .jar file by double click on Windows 7 64-bit?
- Add JAR files to a Spark job – spark-submit
- How to make an executable JAR file?
- Eclipse: How to build an executable jar with external jar?
- How to bundle a native library and a JNI library inside a JAR?
- The issue of * in Command line argument
- Difference between jar and war in Java
- What’s the best way to distribute Java applications? [closed]
- How to use JarOutputStream to create a JAR file?
- Access restriction: The type ‘Application’ is not API (restriction on required library rt.jar)
- How to convert AAR to JAR
- What is the maven-shade-plugin used for, and why would you want to relocate Java packages?
- Determine which JAR file a class is from
- How can I write a Java application that can update itself at runtime?
- Java creating .jar file
- Extract and load DLL from JAR
- Android Library Gradle release JAR
- Modifying a file inside a jar
- Execute .jar file from a Java program
- Run exe which is packaged inside jar file
- Reference jars inside a jar
- Differences between “java -cp” and “java -jar”?
- Android Archive Library (aar) vs standard jar
- How to bundle images in jar file
- Java command line with external .jar
- Build project into a JAR automatically in Eclipse
- What is the best way to avoid maven-jar?
- Python: How can I execute a jar file through a python script
- Classpath resource within jar
- How can I include external jar on my Netbeans project
- Spark spark-submit –jars arguments wants comma list, how to declare a directory of jars?
- Jar Mismatch Found 2 versions of android-support-v4.jar in the dependency list
- How to include JAR dependency into an AAR library
- Difference between extracting and packaging libraries into a jar file
- Copy directory from a jar file
- What is the “String args[]” parameter in the main method?
- Finding unused jars used in an eclipse project
- Can values defined in MANIFEST.MF be accessed programmatically?
- ClassNotFoundException/NoClassDefFoundError in my Java web application
- I am getting “java.lang.ClassNotFoundException: com.google.gson.Gson” error even though it is defined in my classpath
- “Could not find the main class” error when running jar exported by Eclipse
- How to include local jar files in Maven project [duplicate]
- How to includes all images in jar file using eclipse
- Find a jar file given the class name?
- IntelliJ GUI Designer Maven Executable JAR Export
- How to build a jar using maven, ignoring test results? [duplicate]