Board index » jbuilder » Can't seem to find the JDK

Can't seem to find the JDK


2005-02-09 09:46:01 AM
jbuilder17
I am trying to compile a project in JBuilder 2005 that compiled without
error in JBuilder5. I'm a bit embarrassed to say I am getting hundreds of
"cannot find symbol" errors on classes like the String and Hashmap below and
I've no idea why. The String I can understand since it is in java.lang, but
it should be able to find HashMap.
I am at a loss as to how the project is mis-configured since the default
"java version 1.4.2_04-b05" JDK I am using is shown in Tools/Configure/JDK
as accessing the jar files without error.
This is a sample of the code:
import java.io.*;
import java.util.*;
public class SFICodewordProtection implements Serializable {
private String userKey ;
private HashMap codewordProtection = new HashMap();
Any help is appreciated. Thanks.
Tom
 
 

Re:Can't seem to find the JDK

Tom Conlon wrote:
Quote
I am trying to compile a project in JBuilder 2005 that compiled without
error in JBuilder5. I'm a bit embarrassed to say I am getting hundreds of
"cannot find symbol" errors on classes like the String and Hashmap below and
I've no idea why. The String I can understand since it is in java.lang, but
it should be able to find HashMap.

I am at a loss as to how the project is mis-configured since the default
"java version 1.4.2_04-b05" JDK I am using is shown in Tools/Configure/JDK
as accessing the jar files without error.
That may be so, but what is the JDK setting for your
particular project? (Project Properties dialog)
It may be that the definition is wrong. I have
seen this happen when I migrated projects from
an older version of JBuilder, or from one platform
(Windows) to another (Mac).
--
Paul Furbacher (TeamB)
Save time, search the archives:
www.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.
 

Re:Can't seem to find the JDK

Quote
Tom Conlon wrote:

>I am trying to compile a project in JBuilder 2005 that compiled without
>error in JBuilder5. I'm a bit embarrassed to say I am getting hundreds
>of "cannot find symbol" errors on classes like the String and Hashmap
>below and I've no idea why. The String I can understand since it is in
>java.lang, but it should be able to find HashMap.
>
>I am at a loss as to how the project is mis-configured since the default
>"java version 1.4.2_04-b05" JDK I am using is shown in
>Tools/Configure/JDK as accessing the jar files without error.

That may be so, but what is the JDK setting for your
particular project? (Project Properties dialog)
It may be that the definition is wrong. I have
seen this happen when I migrated projects from
an older version of JBuilder, or from one platform
(Windows) to another (Mac).

I selected "java version 1.4.2_04-b05" from the available JDK selections,
and there are no apparent errors in Project Properties or the
Tools/Configure. I am using all the preconfigured settings for the JDK
without adjustments.
Tom
 

{smallsort}

Re:Can't seem to find the JDK

Tom Conlon wrote:
Quote
I selected "java version 1.4.2_04-b05" from the available JDK selections,
and there are no apparent errors in Project Properties or the
Tools/Configure. I am using all the preconfigured settings for the JDK
without adjustments.

Tom


I had this same problem a couple of weeks ago. I ended up creating a
new JDK definition and setting the project to use it. That clears up
the problem. I'm still not really sure what caused it, though.
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html
 

Re:Can't seem to find the JDK

Quote
>I selected "java version 1.4.2_04-b05" from the available JDK selections,
>and there are no apparent errors in Project Properties or the
>Tools/Configure. I am using all the preconfigured settings for the JDK
>without adjustments.
>
>Tom

I had this same problem a couple of weeks ago. I ended up creating a new
JDK definition and setting the project to use it. That clears up the
problem. I'm still not really sure what caused it, though.

--

Regards,

Lori Olson [TeamB]

------------
Thanks for the suggestion Lori, but that didn't work for me either. I
created a new JDK with the same directory as jdk1.4. JBuilder automatically
loaded all the jar files for me. I switched the Project|Properties to this
new JDK. Got the identical errors.
I have also tried adding a new required library with the jdk1.4 jars and the
compiler didn't find those either. It seems the project is not finding any
of these libraries - the JDK or the required. I can't imagine how that can
be. There is no overall configuration parameter that affects all this is
there? It's as though the entire classpath has been lost.
Baffled Tom
 

Re:Can't seem to find the JDK

Tom Conlon wrote:
Quote
Thanks for the suggestion Lori, but that didn't work for me either.
Do you get the same errors if you try to compile a class that's in a
package? Your example code didn't include a package statement. Maybe
you just left it out as inconsequential, but it makes me wonder.
There were changes in JDK 1.4 to the way the default package is handled.
I don't think the problems you're describing sound like what I'd
expect from a default package class, but I think it's worth the experiment.
--
Gillmer J. Derge [TeamB]
 

Re:Can't seem to find the JDK

Quote
Tom Conlon wrote:
>Thanks for the suggestion Lori, but that didn't work for me either.

Do you get the same errors if you try to compile a class that's in a
package? Your example code didn't include a package statement. Maybe you
just left it out as inconsequential, but it makes me wonder.

There were changes in JDK 1.4 to the way the default package is handled. I
don't think the problems you're describing sound like what I'd expect from
a default package class, but I think it's worth the experiment.

I left it out thinking it wasn't relevant. It's there. Here's the entire
initial code:
package sfi.reg;
import java.io.*;
import java.util.*;
public class SFICodewordProtection implements Serializable {
private long installDateTime;
private long lastDateTime ;
private long expireDateTime ;
private String userKey ;
private boolean isRegistered = false;
private final transient String [] keys = new
String[]{"D19B4G3125","D19B4H2277","D19B4I1458","D20B1N2220","D20B1N2023"};
private HashMap codewordProtection = new HashMap();
And here are the first few errors:
"SFICodewordProtection.java": cannot find symbol; symbol: class Serializable
at line 16, column 47
"SFICodewordProtection.java": interface expected here at line 16, column 47
"SFICodewordProtection.java": cannot find symbol; symbol : class String,
location: class sfi.reg.SFICodewordProtection at line 20, column 11
"SFICodewordProtection.java": cannot find symbol; symbol : class String,
location: class sfi.reg.SFICodewordProtection at line 22, column 27
"SFICodewordProtection.java": cannot find symbol; symbol : class HashMap,
location: class sfi.reg.SFICodewordProtection at line 23, column 11
 

Re:Can't seem to find the JDK

Quote
Tom Conlon wrote:
>Thanks for the suggestion Lori, but that didn't work for me either.

Do you get the same errors if you try to compile a class that's in a
package? Your example code didn't include a package statement. Maybe you
just left it out as inconsequential, but it makes me wonder.

There were changes in JDK 1.4 to the way the default package is handled. I
don't think the problems you're describing sound like what I'd expect from
a default package class, but I think it's worth the experiment.

Another circumstance here that I can think of is that I did not build this
project from scratch. This project was originally created in JBuilder5. I
installed JBuilder2005 and the first time I started it it loaded the
JBuilder5 project. I have been reconfiguring this project in 2005 ever
since.
Could there be a problem with 2005 importing JBuilder5 projects? I hate to
think about starting from scratch, but if you think I have to...
Tom
 

Re:Can't seem to find the JDK

Tom Conlon wrote:
Quote
Could there be a problem with 2005 importing JBuilder5 projects? I
hate to think about starting from scratch, but if you think I have
to...

Tom
JBuilder2005 has problems with JBUilder9 projects, so I can only
imagine how much worse it would be for JBuilder5. Recreating the
project sounds like a good idea at this point.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

Re:Can't seem to find the JDK

Tom Conlon wrote:
Quote
Another circumstance here that I can think of is that I did not build this
project from scratch. This project was originally created in JBuilder5. I
installed JBuilder2005 and the first time I started it it loaded the
JBuilder5 project. I have been reconfiguring this project in 2005 ever
since.

Could there be a problem with 2005 importing JBuilder5 projects? I hate to
think about starting from scratch, but if you think I have to...

Tom


I don't know. If that works, then great. But I was just switching to a
new PC, and had copied my JBuilder 2005 config from the old machine when
this happened to me. So I got this error on a JBuilder 2005 project...
--
Regards,
Lori Olson [TeamB]
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html
 

Re:Can't seem to find the JDK

Kevin Dean [TeamB] wrote:
Quote
[...] Recreating the
project sounds like a good idea at this point.
To complement what Kevin suggests, I'd try this:
Copy the src, doc and bak ... all folders *except* the
classes folder from the original project folder to
a new folder.
Start up JB 2005, and File>New>Project>Project from
existing source. But be sure to point to the *new*
project folder in which you have the *copies* of src,
etc.
Reconfigure your required libraries.
Compile.
If that works, re-create your runtime configurations.
--
Paul Furbacher (TeamB)
Save time, search the archives:
www.borland.com/newsgroups/ngsearch.html
Is it in Joi Ellis's Faq-O-Matic?
www.visi.com/~gyles19/fom-serve/cache/1.html
Finally, please send responses to the newsgroup only.
That means, do not send email directly to me.
Thank you.
 

Re:Can't seem to find the JDK

Quote
To complement what Kevin suggests, I'd try this:

Copy the src, doc and bak ... all folders *except* the
classes folder from the original project folder to
a new folder.

Start up JB 2005, and File>New>Project>Project from
existing source. But be sure to point to the *new*
project folder in which you have the *copies* of src,
etc.

Reconfigure your required libraries.

Compile.

If that works, re-create your runtime configurations.

That worked! I created new directories and copied the source files over,
created a new project with new folders and files. Using the default JDK1.4
the compiler found the java classes from the first compile on. I have
closed and restarted JBuilder several times as I have loaded the Required
Libraries I need (I am also upgrading the tomcat libraries from 3.2.1 to
5.0.27) and I have just now rebuilt the entire project without error.
Several times, since I couldn't believe it.
Thanks all of you for your help,
Tom