Posts

Showing posts from November, 2013

Failed to load Main-Class manifest attribute from HelloWorld.jar - SOLVED

Image
When i try to compile a jar file using the below command in command prompt, java -jar HelloWorld.jar i got an error like Failed to load Main-Class manifest attribute from HelloWorld.jar This is due to the missing launch configuration.  The Main-Class header needs to be in the manifest for the JAR file - this is metadata about things like other required libraries. See the  Sun documentation  for how to create an appropriate manifest. Simply, i followed the eclipse for exporting the jar file instead of remembering all the commands. and choose as specified below. and choose the following options below. 1. Choose your class that contains MAIN method. 2. Choose the destination of Jar file 3. Once, one and two steps are done, Click Finish. Now run the same command via command prompt,  java -jar HelloWorld.jar This will not throw an

Deleting files with SIZE range

The  -a  in an explicit  AND  operator that allows you to join two primaries. In this case creating a range using  -size . rm -rf `find . -size +300c -a -size -400c`; The above command deletes the files which size are in between 300kb to 400kb. Note the size is a numeric argument that can optionally be appended with  +  and  - .  Numeric arguments can be specified as     +n      for  greater than n,    -n      for  less than n,     n      for  exactly n.