0

1)I have jar file named abc.jar.
2) There is a class file def.class inside abc.jar which has main method and I want to run this class. This class is under package gog.com.custom
3) This class refers a property file xyz.properties which is outside this abc.jar

How can I run def.class along with xyz.properties from command line ?

dsh
  • 12,037
  • 3
  • 33
  • 51
Ajaya Rk
  • 5
  • 1
  • 7
  • You need to specify the `Main-Class` attribute in the .jar file’s manifest. As for reading a properties file, answering that requires seeing the code which attempts to read it. If the properties file is read-only, place it inside the .jar; if it is not read-only, put it in a known location like the user’s home directory or the [user’s configuration directory](http://stackoverflow.com/questions/35388882/find-place-for-dedicated-application-folder). – VGR Jan 20 '17 at 17:52
  • Hi, I was manage to run it. def.class already has main method. I was able to resolve the issue java -classpath .;abc.jar;xyz.properties com.aps.pi.def – Ajaya Rk Jan 20 '17 at 18:03

0 Answers0