Reputation:
This is getting to me a bit.
What should be a straightforward and well worn procedure to do something all users need to do is anything but straightforward.
I made the Java class I want to add to all new Java projects into a JAR file. And I got it into the JRE folder using Window > Prefs > Java > Installed JREs, etc. But come runtime, the Java interpreter just doesn't see this class as attached to my projects.
Anyone know how this pesky one is fixed ?
I'm using Eclipse 3.6.2 Helios and JRE 7.
Upvotes: 0
Views: 179
Reputation: 11502
The JRE isn't really intended to be extended in this way. If you must store your shared libraries in the JRE, the ext
folder should be used, rather than the top-level JRE folder. However, even this is usually a bad practice: Is putting external jars in the JAVA_HOME/lib/ext directory a bad thing?.
To add dependencies to your Eclipse projects, use the project's build path. To add dependencies at run-time, use the Java class path.
Upvotes: 2
Reputation: 2792
I would create a userlibrary and add the lib to the project setup. http://goo.gl/pEoto
Upvotes: 0