Title: can I use the eclipse .classpath file to set classpaths and launch a jar from command line?
Tags: eclipse;classpath
Question: After doing some work on setting the eclipse build path, I would like to use what I did (which is in .classpath) to launch a version of my project, where I have only the jar and which has no dependencies compiled in, with the same classpath. Is this possible using the normal java command? Is it possible on the command line, at all? Do I need eclipse to use .classpath?

Here is the accepted answer: If you want to use the build path settings you made in eclipse, you should run your program from eclipse using the "Run As" command. However, this will not run the program from the jar, but from your compiled classes.
If you plan on running the jar file from a command line, you will need to set the classpath using the "-cp" option. I am not aware of any way to pass the eclipse .classpath file to the jvm.
Comment for this answer: Look here for how to run the jar file, though you probably will still have to set the classpath manually: http://stackoverflow.com/questions/4505372/how-to-run-a-jar-file-in-eclipse
Comment for this answer: maybe if I could import that jar as new (binary) project and copy the .classpath over? (I'll accept your answer anyway)


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:05/31/12', 'FavoriteCount': 2.0, 'PostTypeId': 1, 'Tags': '<eclipse><classpath>', 'Title': 'can I use the eclipse .classpath file to set classpaths and launch a jar from command line?', 'ViewCount': 2466, 'id': 10830864, 'user_AboutMe': None, 'user_AccountId': 1010778.0, 'user_DisplayName': 'rwst', 'user_Reputation': 2426.0, 'user_Views': 162.0, 'user_id': 1408339.0}}