The Artima Developer Community
Sponsored Link

Java Answers Forum
CLASSPATHs in Win98.

3 replies on 1 page. Most recent reply: Jun 9, 2002 10:10 AM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Ben Trafford

Posts: 7
Nickname: btrafford
Registered: May, 2002

CLASSPATHs in Win98. Posted: Jun 8, 2002 6:09 PM
Reply to this message Reply
Advertisement
Okay...

I'm using an unfamiliar computer, running Windows 98, and wonder what the heck I could be doing wrong.

I have a project, where the base source is located at:

d:\Ben\Work\HB\Code\com\hg\hb\

All these files are part of the package:

com.hg.hb

Now, I have a helper class, located at:

d:\Ben\Work\HB\Code\com\hg\hb\utilities\Helper.class

In one my source files in the hg, I have the following statement:

import com.hg.hb.utilities.Helper;


All the files have the appropropriate package names. This whole system works just fine under Windows 2000, but under Windows 98, it's broken. This leads me to assume I'm setting my CLASSPATH incorrectly.

My CLASSPATH statement in my autoexec.bat looks like this:

SET CLASSPATH=.;d:\Ben\BensPrograms\j2sdk\lib;d:\Ben\Work\HB\CODE;

When I try to compile, I get the following error message:


d:\ben\work\HB\CODE\com\hg\hb>javac *.java
HBMainFrame.java:12: package com.hg.hb.utilities does n
ot exist
import com.hg.hb.utilities.Helper;
^
HBMainFrame.java:360: cannot resolve symbol
symbol : class Helper
location: class com.hg.hb.HBMainFrame
Helper filter = new Helper();
^
HBMainFrame.java:360: cannot resolve symbol
symbol : class Helper
location: class com.hg.hb.HBMainFrame
Helper filter = new Helper();
^
3 errors


Any help would be appreciated. As I mentioned, everything works fine under Win2k, so it's not a code error. It appears to be something in the environmental variables, but for the life of me, I can't figure out what.


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: CLASSPATHs in Win98. Posted: Jun 8, 2002 10:53 PM
Reply to this message Reply
Based on the clues provided, it looks like you may have a mismatch in case in a part (or parts) of the path name. Generally, Windows lets you get away with ignoring case, but the long file names do really have the exact case and this could be causing your problem in java. The reason it works in Win2k is probably that you started there with all correct case, then copied (or archived & unarchived) your development environment to the Win98 system. So, what I'd do is start at the base and do a "dir /b" on each section of directory that is included in your project (it looks like just a few) and rename them with the correct case. Be careful in your renaming: there was a bug in Win95 at least and I forget if it was fixed for 98 (probably not): when renaming a file/directory if all you change is the case, it would make no change -- you get around this by renaming to some temporary intermediate, like so:

ren COM someTemporaryIntermediate
ren someTemporaryIntermediate com
cd com
ren HG someTemporaryIntermediate
ren someTemporaryIntermediate hg
etc.

(before going to this extra trouble, try it on one directory and see if it works with a simple
ren COM com"
-- if it works, it works -- "dir /ab /b" shows you just the long file names of the directories, so it is easy to check. Incidentally, if it does work without the intermediary, then simply ren com com will do the trick, even though it looks strang: even if the long file name is "COM," ren com com will match it and change it to lowercase. Pretty zany, eh?).

You also might want to have the exact correct case in your classpath, for good measure, although I think this part will work either way.

Ben Trafford

Posts: 7
Nickname: btrafford
Registered: May, 2002

Re: CLASSPATHs in Win98. Posted: Jun 9, 2002 9:37 AM
Reply to this message Reply
Matt,

You hit the nail on the head. When I unzipped my archive, Windows 98 saw fit to change the case on the com directory, making it COM instead.

Once I renamed the directory, and double-checked the case in the classpath, my happy little program once again compiled.

Thank you very much. It was driving me bloody insane.

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: CLASSPATHs in Win98. Posted: Jun 9, 2002 10:10 AM
Reply to this message Reply
Yes! Finally I got one right!

Flat View: This topic has 3 replies on 1 page
Topic: DYNAMIC BINDING Previous Topic   Next Topic Topic: simple number format error

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use