Ćepa
Ćepa

Reputation: 73

Using System Path Variable in Maven project - Eclipse

Upvotes: 0

Views: 574

Answers (1)

mrq
mrq

Reputation: 567

SMART WAY, with java configuration and classpath (unix example, launch your application this way)

java -classpath $PATH <your-class-name>

or

setenv CLASSPATH = $PATH

see unix and windows instructions.

BAD WAY, within application code

  1. You can read the PATH variable from the OS environment calling System.getenv() and then looking for the "PATH" elements within the returned map.
  2. Then you have to parse the string (e.g. with StringTokenizer) obtained to get each folder within the PATH variable
  3. you have to look for your JSON files in each of the folder from previous point

Upvotes: 1

Related Questions