How to use variables for classpath definition in Eclipse launch configurations?

前端 未结 2 681
甜味超标
甜味超标 2020-12-31 12:36

In our project we use Eclipse launch configurations which are under version control to be shared with all developers. Now it is necessary to include an external archive to a

2条回答
  •  梦毁少年i
    2020-12-31 13:04

    Edit your launch configuration. Go to the "classpath" tab. Focus on "User Entries". Click the "Advanced" button.

    • To add an entry based on a classpath variable, select Add classpath variable and click OK. A dialog will open. Focus on M2_REPO and click the "Extend" button. Select your JAR file.
    • To add an entry based on a system environment variable, select Add variable string, and in the editbox below, type: ${env_var:your-environment-variable-name}/path-to-jar. For example, if your system environment variable is MYVAR and the JAR file is under subdir/myfile.jar, you should type ${env_var:MYVAR}/subdir/myfile.jar.

提交回复
热议问题