Can I use the eclipse.classpath file to set the class classes and run the jar from the command line?

After doing some work on setting up the eclipse build path, I would like to use what I did (which is located in .classpath) to run a version of my project where I only have a jar and which does not have dependencies compiled into, with the same classpath. Is this possible with a regular java command? Is this possible on the command line? Do I need to use eclipse to use .classpath?

+4
source share
1 answer

If you want to use the build path settings created in eclipse, you must run your program from eclipse using the Run As command. However, this will not start the program from jar, but from your compiled classes.

If you plan to run the jar file from the command line, you will need to set the class path using the -cp option. I do not know how to transfer the eclipse.classpath file to jvm.

+2
source

Source: https://habr.com/ru/post/1415324/


All Articles