0

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.

2
  • 3
    Do you always want to use your IDE to run your programs? Commented Aug 9, 2011 at 14:53
  • Not generally, but in this case Eclipse is an integral part of our final deliverable to our client. Commented Aug 9, 2011 at 19:12

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Note that system properties and -D arguments are the same thing :-)
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.
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.