fanshoogl.blogg.se

How to make a new file in command line
How to make a new file in command line















If you don’t want to write the path of the main class each time you run the jar, you can update the manifest file of the jar and add your main class there. In order to run this kind of jar, you must know the full path of the main class and use the following command: java -cp Į.g.

how to make a new file in command line

Some developers forget to define the main class inside the manifest file while creating the executable jar, when you get this kind of jar and try to run the above command, you get an error message like : ‘no main manifest attrbute’. In order to run the jar, just type the following command in the windows console: java -jar winrar, 7-zip => open MANIFEST.MF file under META-INF => then check whether there exists an attribute called Main-Class and is set properly. In order to check if the main class is already defined:Įxtract your jar using any archive tool e.g. Jars with predefined main classĮvery executable jar should hold a MANIFEST.MF file which holds important information about the jar itself, if you’re lucky enough you get a jar with a predefined main class in MANIFEST.MF Throughout this tutorial, we consider that you’ve already installed java on your machine, and you set up properly the java environment variables. In case you don’t know what’s an executable jar, refer to our previous tutorial about creating executable jars in java.

how to make a new file in command line

In this tutorial we define the different ways to run an executable jar through the windows command line.

HOW TO MAKE A NEW FILE IN COMMAND LINE HOW TO

So you got an executable jar and you are wondering how to run it!.















How to make a new file in command line