questions on "run on server" and "run configurations"
I am studying to use an open source library. But when I right click some example java files, some file gives me an option like "run as application", which make senses to me. But some others just give me an option like "run configuration" without other options. While some others just give me an option like "run on server" without other options. What do "run configu开发者_如何学编程ration" and "run on server" mean? I am using Eclipse IDE.
Eclipse is doing its best to figure out what type of file you have and how you can execute it based on contextual clues.
"Run on server" lets you test web applications on an application server you have configured in your servers view. This generally appears if your active file is part of a web application.
"Run as application" tries to execute a Java class directly by calling its main
method.
"Run configurations" are definitions for how Eclipse should execute a particular file, including things like VM arguments, command line arguments, etc.
There are other "Run as ..." that will appear for other file types, such as "Run as JUnit Test", etc.
The run configuration is used to set classpaths, add bootstrap entries, etc. If you are going to be using resources outside of what you have written within your program, you must let your program know about them by adding them to the classpath. That is done within the run configuration. Also, it is used for runtime arguments, setting environment variables, etc. Basically setting everything you need to get your program to run correctly.
Run on server means that you have a server associated with your project, and you wish to start the associated server.
精彩评论