Can anyone help me on how I have to run a java application which is in a package, from cmd?
Please give me the necessary line that I have to type.
EDIT: (Copied a clarifying comment from one of the answers below)
No I mean a normal Java aplication that belongs to a package, like:
package x; class SampleOnly{ }
How you compile (and run) that file.
This little “bash session” should explain it:
How to execute an arbitrary jar file, depends on how the jar file in question is pcakaged:
If it’s packaged with a manifest containing a Main-class declaraton, you simply do
If it’s a regular jar-file you need to know the main class. Let’s say it’s
package.Main:(I answered this (indirectly) here: How to convert Java program into jar?) –>