Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / September 2006

Tip: Looking for answers? Try searching our database.

Import Map.class wrong version error

Thread view: 
Sharad - 26 Sep 2006 19:55 GMT
Hi There....

I'm running into these import problems....
I'm trying to import the java.util.Map and java.util.HashMap Class on a
IBM AIX server running java 1.4.2.

Could anyone please help me in identifying what is that I am doing
wrong....
I have core.jar that has these files in the Lib dir...but still I get
the error...notably it says it is Wrong version 48 expecting 45....

I have no idea of this error could b....

Appreciate your response

/u/sharadch> $CLASSPATH
ksh:
/usr/java14/jre/lib/core.jar:/adw/adwinsp1/sqllib/java/db2java.zip:/adw/adwinsp1/sqllib/java/db2jcc.jar:/adw/adwinsp1/sqllib/java/sqlj.zip:/adw/adwinsp1/sqllib/function:/adw/adwinsp1/sqllib/java/db2jcc_license_cisuz.jar:/adw/adwinsp1/sqllib/java/db2jcc_license_cu.jar:.:
not found.
/u/sharadch> $PATH
ksh:
/usr/java14/jre/bin:/opt/oracle/product/9.2.0/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/usr/bin:/usr/ucb:/etc:/usr/dt/bin:/opt/openlink5/bin:/opt/openlink5/samples/ODBC:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java130/jre/bin:/usr/java130/bin:/usr/local/bin:/u/sharadch/bin:/opt/sas:/usr/local/bin:/opt/ks/bin:/opt/openlink5/bin:/opt/datamart/utilities:/usr/atria/bin:/adw/adwinsp1/sqllib/bin:/adw/adwinsp1/sqllib/adm:/adw/adwinsp1/sqllib/misc:/usr/bin:/etc:/usr/sbin:/usr/ucb:/u/sharadch/bin:/usr/bin/X11:/sbin:
not found.
/u/sharadch> cat HelloWorld.java
import java.util.Map;
import java.util.HashMap;

class HelloWorld {
 public static void main(String args[]) {

   System.out.print("Java Works !!!! ");

 }
}/u/sharadch> javac  HelloWorld.java
error: Invalid class file format:
/usr/java14/jre/lib/core.jar(java/util/Map.class), wrong version: 48,
expected 45
HelloWorld.java:1: Class java.util.Map not found in import.
import java.util.Map;
      ^
error: Invalid class file format:
/usr/java14/jre/lib/core.jar(java/util/HashMap.class), wrong version:
48, expected 45
HelloWorld.java:2: Class java.util.HashMap not found in import.
import java.util.HashMap;
      ^
error: Invalid class file format:
/usr/java14/jre/lib/core.jar(java/lang/Object.class), wrong version:
48, expected 45
HelloWorld.java:4: Superclass java.lang.Object of class HelloWorld not
found.
class HelloWorld {
     ^
6 errors
Petterson Mikael - 27 Sep 2006 11:08 GMT
> Hi There....
>
[quoted text clipped - 50 lines]
>       ^
> 6 errors

Hi,

Do 'which java' and check env. variables JAVA_HOME PATH.
Post result here.

cheers,

//mikael
Sharad - 27 Sep 2006 23:33 GMT
Thanks Mikael,

which java resulted to /usr/java14/jre/bin/java
$JAVA_HOME to nothing...

> > Hi There....
> >
[quoted text clipped - 59 lines]
>
> //mikael
Petterson Mikael - 28 Sep 2006 08:36 GMT
> Thanks Mikael,
>
> which java resulted to /usr/java14/jre/bin/java

if you do 'java -version' what do you get?

Are you using sun's version? I cannot see a core.jar ( i am solaris and
linux).

> $JAVA_HOME to nothing...
>
[quoted text clipped - 61 lines]
>>
>>//mikael


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.