aspose file tools*
The moose likes Cattle Drive and the fly likes Not able to compile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Not able to compile" Watch "Not able to compile" New topic
Author

Not able to compile

Elizabeth Jacob
Greenhorn

Joined: Feb 19, 2001
Posts: 28
Hi guys,
my computer needed to be reinstalled and then i downloaded jdk1.2.2 .I saved the file Say.java in c:\java .when i try to compile i'm getting the following error:
error:can't read: Say.java
could it be something with setting the PATH and CLASSPATH ?
Any help will be appreciated.
Thanks,
Elizabeth.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9053
    
  12
What do you currently have for your PATH and CLASSPATH settings?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Richard Boren
Ranch Hand

Joined: Mar 01, 2001
Posts: 233
The error msg: error:can't read: Say.java when compiling is most likely caused because your PATH is not correct. You should check both the PATH and CLASSPATH and make sure they have the same dir names for your JDK1.2 and where you keep your source.
- error:can't read: SomeClass.java (is usually a PATH problem).
- Exception in thread "main" java.lang.NoClassDefFoundError: Someclass/java (is usually a CLASSPATH problem).
The above assumes you typed the class's name correctly to begin with.
Also it would help everyone if you would tell them what OS you are using.
Hope this helps
Elizabeth Jacob
Greenhorn

Joined: Feb 19, 2001
Posts: 28
Thanks to both of you.
i'm working on windows 95.i set the CLASSPATH as c:\java & did'nt know what to do with the PATH variable.could you pl tell me how to set those two variables thru the DOS prompt.
Thanks,
Elizabeth.
Richard Boren
Ranch Hand

Joined: Mar 01, 2001
Posts: 233
In your autoexec.bat use:
SET PATH==%PATH%;C:\your_jdk_version;C:\your_jdk_version\bin;c:\where_your_java_sources_is
SET CLASSPATH=c:\where_your_java_sources_is\;.;
where your_jdk_version = what ever the directory name is for your jdk.
Note: I have found that if you use the default dir when installing the JDK for jdk1.1+ it makes life easier when dealing with the classpath because you only have to put where you keep you source and tell it to look in the local dir, that's the ;.; part. For example my path and classpath are as follows:
SET PATH=%PATH%;C:\jdk1.3;C:\jdk1.3\bin;D:\my_java
SET CLASSPATH=D:\My_Java\;.;
You can see your current setting by entering:
c:>set
This will show you all your current settings.
After you have updated your autexec.bat you will need to reboot for the new setting.
Good luck.
[This message has been edited by Richard Boren (edited June 05, 2001).]
Elizabeth Jacob
Greenhorn

Joined: Feb 19, 2001
Posts: 28
Thanks Richard,i'll try that.

Elizabeth.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not able to compile