In previous posts, I've discussed how to include .jar files in the CLASSPATH variable. These settings work fine if you're coding in gedit (or SciTE) and using the javac and java commands, however, if using an IDE such as Eclipse you will get error messages when you include packages (or jar files) in your code. Below I outline how I solved this issue in Eclipse.
In Eclipse (version 3.4.0) go to the menu then 'Project'In the panel on the left, Select 'Java Build Path'In the 'Java Build Path' panel now loaded on the right Select the 'Libraries' tabClick the button 'Add External JARs...'Browse to your JAR file, select it then Click OK.Finally, Click OK in the 'Java Build Path' panel to exit it
Eclipse should now (hopefully) recognise the included package and the errors should disappear. If this doesn't happen, possibly try to exit and reload Eclipse. This worked for me, so I hope it can do the same for you!
(PS. This was done on a Linux box, but I don't imagine Windows would be much, if any different.)
tagged: java // Comments [0]
Related posts:Learning LaTeX and EclipseHow to set CLASSPATH (and PATH) for Java in LinuxHow to set PATH and CLASSPATH for Java in VistaRunning Java classes with packages in Command Prompt
Disclaimer The posts on this blog are provided "AS IS" with no warranties. The opinions expressed herein are my own personal opinions and do not represent any other person's views in anyway.