I'm very new to all Java related programming. For a school assignment, I've created my Java application using BlueJ. Apparently, the application should be able to run from the command prompt with the following line:
myapp -compress fileName
Honestly, I don't have the slightest idea about how to setup such:
- My application has a
Main
class. Am I supposed to change it to be calledmyapp
? - I've been running my app with
java Main compress filename
. I see that now I shouldn't be using thejava
key. But of course, as it is now, it won't work if I remove it. How can I run the app without it? - Is there a difference between having the
compress
argument I always use and the-compress
one they tell me? Is that dash (-) any special?
Looking at this page: http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html, it seems to insist that to run my program I do need to use the java
key. And the dash seems to be used for something called options - there are standard and non-standard. However, there doesn't seem a way to make a "custom" one (-compress).
So my question is, how can I run my application with the above format?