Is it possible to use Eclipse's classpath variables within in Java code? I have several bin directories for multiple projects that are defined in classpath variables, and need to reference them multiple times within one of my projects.
-
3Do you always want to use your IDE to run your programs?user unknown– user unknown2011-08-09 14:53:47 +00:00Commented Aug 9, 2011 at 14:53
-
Not generally, but in this case Eclipse is an integral part of our final deliverable to our client.codewario– codewario2011-08-09 19:12:26 +00:00Commented Aug 9, 2011 at 19:12
Add a comment
|
1 Answer
Tying something unique to an IDE to your application code is not particularly good practice. Try instead to make use of system properties, environment variables or the -D arguments to the application.
3 Comments
JB Nizet
Note that system properties and -D arguments are the same thing :-)
adarshr
Yes, very much. Thanks for noting that. It's just that we can set them conditionally in our program whereas can't do the same with
-D arguments.codewario
Eclipse is going to be a required tool for the final deliverable to our client, so in this case the IDE will always be present. I ended up just adding the required output folders to the classpath as recommended above.