简体   繁体   中英

Does it possible add extenal file to classpath in IntelliJ idea?

AFAIK IntelliJ idea automatically add all dependencies to classpath. I need add one file more. It is common.properties that in external folder to project. This file is common for set of project so I would like not create copy of this file for each project but have only one point to change. I understand that exists direct way use -cp option. But in this case I should manually write all jars (more than 100). Could you please advise the best way to add common.properties to classpath so application could found it?

Nothing is done "automatically". You shouldn't depend on magic. Better to understand how and why things are done.

The right way to do it is to right click on the folder in question in your project view and mark the directory as either source, test source, resources, or test resources.

The right way to specify libraries for CLASSPATH is to open the project (look for the "wrench" on the menu bar), find the Libraries, and add your /lib folder with the JARs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM