SDK1.4 and imports

OK I抣l start by apologising for this post, as I have read other posts where people are struggling after the installation of sdk1.4 and they seem to get a frosty reception. That said I need help, and if my question has been addressed many times before I don抰 expect a step by step guide, but if someone could point me to a relevant manual or help file I would be very grateful.

OK, here goes, I was mid way through coding an application in Java using JRE 1.3 and SDK1.2.2 but it kept crashing when I populated combo boxes from an access database, so on recommendation I installed the latest versions of java.

The runtime environment now works great, apart from changing the look and feel of my application, however I now get compiler errors on previously compiled code.

OK cutting to the chase ?It doesn抰 seem to like my import commands. My code is split into many different classes, pulled together by import commands at the beginning, these however through the following error:

import ManagerInformationValidation;

^

C:\Coding\ManagerInformationInterface.java:2: '.' expected

Any help would be appricated.

Kris Dowse

[1175 byte] By [kr1sdowse] at [2007-9-27 21:23:23]
# 1
maybe recompiling the old classes would help? it helps when some other too wierd errors pop up...
VaskoL at 2007-7-7 3:18:14 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2
The new rule in JDK 1.4.1 is that you can not import classes that are not in a package.
tgpaul at 2007-7-7 3:18:14 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 3
> The new rule in JDK 1.4.1 is that you can not import> classes that are not in a package.That should be JDK 1.4.
tgpaul at 2007-7-7 3:18:14 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 4
Sorry for the delayed reply. What are my options then if I can't import my classes. Is there anyway to add them to a package? Surly I don't have to have one huge file, I thought java was meant to be an OO language? Would really apprecaite some further help.Kris
kr1sdowse at 2007-7-7 3:18:14 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 5
Just put your classes in a package and import the package. You need to add the "package" statement as the first line in the class file.
tgpaul at 2007-7-7 3:18:14 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 6

I appreciate the continued help, but if you抮e not already ?can you treat me as an idiot!? How do I add my existing classes to a package? Does the way I have made two way associations between classes remain unaffected? And what is the command for importing a package? If you could point me in the direction of a tutorial or help file I would be very grateful ?this idea of packages is completely new to me.

Thanks again Kris

kr1sdowse at 2007-7-7 3:18:14 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 7

Kris-

A package is just a logical grouping of related classes. If you don't specify a package for a particular class file, it gets thrown into the "default" package. I suspect that all your source files are in the same subdirectory - if this is true, then you can just ditch all your import statements and be good, 'cause all your classes would be in the default package.

HTH

Lee

tsith at 2007-7-7 3:18:15 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 8
Great Stuff, I'm off again - thank you!
kr1sdowse at 2007-7-7 3:18:15 > top of Java-index,Archived Forums,New To Java Technology Archive...