S Chan wrote:My question is - "what is the REAL use of classpath?"
I wonder how you experienced programmers "magically" know libraries are required when working on open/shared projects out there...
Another thing about classpath that leaves me puzzled is that, it is surely not distribution-friendly.
Let's say I have made an executable Jar and distribute this to other people. I think double-clicking the Jar is the most intuitive way of starting the Jar for most people. If my Jar requires specific classpaths, I don't think there is an easy way to explain to them how to specify the classpaths,
S Chan wrote:My question is - "what is the REAL use of classpath?" I want to clarify that I know how to use the -classpath parameter, so my question is not about 'what is classpath', but more of 'when and why use classpath?'
S Chan wrote:If I have some classes or packages, I would want to put inside my project workspace or in the lib folder of my projects so that they can be included during compile. Am I right on this? This is what I think a make-everthing-as-simple-as-possible approach it is, as far as I can reason myself. Why would I want to store some classes in some alien paths and include them using the -classpath parameters? Isn't that making things more complicated?
S Chan wrote:I have experience in working in a team project, and we used SVN to share source code. I understand that when there is some external libraries, it is wise to not put them in the SVN, but put them in the local storage in our individual working machines and link them with classpath... However, I find that this is quite troublesome when I set up the workspace for the first time or when I switch working environment/machines.
S Chan wrote:Another thing about classpath that leaves me puzzled is that, it is surely not distribution-friendly. Let's say I have made an executable Jar and distribute this to other people. I think double-clicking the Jar is the most intuitive way of starting the Jar for most people. If my Jar requires specific classpaths, I don't think there is an easy way to explain to them how to specify the classpaths, not to mention the "classpaths" may be different on different machines or the required classes/packages may not even exist on running machines... Or am I missing something??? Should I use something like Launch4J to ease this problem?
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Attractive, successful people love this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|