I have a program that I finished and compiled on one computer in our lab. It is saved under my username for Ubuntu Server. It imports a package that compiled fine on that computer, as well as most others. However, that lab is currently in use so I am in another one. I logged into my account and tried compiling the same program, and it is failing to import the package. I opened up the .bashrc file and lo, the CLASSPATH is still set and the packages have not moved. Is there an explanation as to why this is happening and how it could be fixed?
then what is printed; is it the correct classpath that you expected? If not, then the setting in .bashrc is not being used for some reason; you'd have to dig around a little in the system to find out why not.
Ok, then you'll have to be a little more specific. What does the content of the CLASSPATH look like? Are there no typos, no spaces that should not be there, etc.? Note that on Ubuntu, directories and jar files in the CLASSPATH should be separated with colons ":" and not semi-colons ";" as on Windows. (If you use semi-colons, it will not work).
I advise against setting CLASSPATH in .bashrc, doing so will almost guarantee that you will have some unwanted surprises. It is better to set it within a script taht passes the value as the -cp entry on the java command line itself. Also if you do that you can use ps to view the command line used to run the java executable to verify that you got it correct (which is handy if a script start the app)