Deprecated: Assigning the return value of new by reference is deprecated in /home/techmasa/public_html/wp-content/plugins/sem-cosmos-link/sem-cosmos-link.php on line 90

Deprecated: Assigning the return value of new by reference is deprecated in /home/techmasa/public_html/wp-content/plugins/sem-recent-posts.php on line 942

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/techmasa/public_html/wp-content/plugins/sem-cosmos-link/sem-cosmos-link.php:90) in /home/techmasa/public_html/wp-content/plugins/wordpress-automatic-upgrade/wordpress-automatic-upgrade.php on line 121

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/techmasa/public_html/wp-content/plugins/sem-cosmos-link/sem-cosmos-link.php:90) in /home/techmasa/public_html/wp-content/plugins/wordpress-automatic-upgrade/wordpress-automatic-upgrade.php on line 121
TechMasala - Technology Spice Rack » 2006 » April » 16

Archive for April 16, 2006

Troubleshooting tip #6 - Did you forget the dot in CLASSPATH?

Most of the time I have seen beginners struggle with compiling programs that use package names. Generally when you are learning java, you write everything in one program, compile and run the program. This means that you would never start practicing using package names. These days most of the junior developers directly start working on a IDE. When you start with IDE you miss out certain stuff which is fundamental. If you are a developer try writing a simple program using a package name and compile and make it run in the DOS prompt. If you are successful, well and good.

The point here is not about packages but when you get into a compilation error that says that a particular class is not found, and interestingly the class that the compiler is looking for might be under the same directory as your other classes might be or from where you are compiling. Wait a minute, did you check if you had a CLASSPATH variable set? If yes did you also include the current directory in that path? OK you might ask, how to add the current directory? Today it might be c:\java, tomorrow I might run another program in another location. Well if you didn’t know one of the basic information that a OS recognizes . (dot) as a current directory then know it now. Include . (dot) in your CLASSPATH variable, the java compiler looks into the directory where you are trying to compile from as well. The class not found issue occurs when you have a CLASSPATH variable set that does not include the current directory and a class refers to other classes in the same project under different package structure.


Deprecated: Function ereg_replace() is deprecated in /home/techmasa/public_html/wp-content/plugins/sociable/sociable.php on line 64
Blink this Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at blinklist.com    Bookmark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at blogmarks    Bookmark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at del.icio.us    Digg Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at Digg.com    Fark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at Fark.com    Bookmark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at Furl.net    Bookmark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at NewsVine    Bookmark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at reddit.com    Bookmark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at Simpy.com    Bookmark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at Spurl.net    Bookmark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? with wists    Bookmark Troubleshooting tip #6 - Did you forget the dot in CLASSPATH? at YahooMyWeb

Comments      Cosmos


Creative Commons License  This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.