You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mary M <kr...@gmail.com> on 2006/06/08 10:21:50 UTC

re: Problems Compiling Using Ant

Dear All,

When I ran the ant command, I got the error below -

--------------------------------------------------------------------------------------------------------------------------
compile:
[javac] compling 1 source file to ...\WEB-INF\classes
[javac] MyBean.java:5: cannot access java.lang.Object
[javac] bad class file:
...\Java\jdk1.5.0_06\jre\lib\rt.jar<java/lang/Object.class>
[javac] class file has wrong version 49.0, should be 48.0
[javac] please remove or make sure it appears in the correct subdirectory of
the classpath
[javac] String personName;
[javac]
[javac] 1 error
----------------------------------------------------------------------------------------------------------------------------

I am not too sure what the problems about - I did not hard code any path in
the build file. I also try to use javac in the command line to compile the
.java file and I can get the .java to compiled...

Any one has any idea? Any information would help - I am very new to this
area.

Thank you for your help in advance.

Regards

Mary

Re: Problems Compiling Using Ant

Posted by Petar Tahchiev <pa...@gmail.com>.
On 08/06/06, Mary M <kr...@gmail.com> wrote:
> Dear All,
>
> When I ran the ant command, I got the error below -
>
> --------------------------------------------------------------------------------------------------------------------------
> compile:
> [javac] compling 1 source file to ...\WEB-INF\classes
> [javac] MyBean.java:5: cannot access java.lang.Object
> [javac] bad class file:
> ...\Java\jdk1.5.0_06\jre\lib\rt.jar<java/lang/Object.class>
> [javac] class file has wrong version 49.0, should be 48.0
> [javac] please remove or make sure it appears in the correct subdirectory of
> the classpath
> [javac] String personName;
> [javac]
> [javac] 1 error
> ----------------------------------------------------------------------------------------------------------------------------
>
> I am not too sure what the problems about - I did not hard code any path in
> the build file. I also try to use javac in the command line to compile the
> .java file and I can get the .java to compiled...
>
> Any one has any idea? Any information would help - I am very new to this
> area.
>
> Thank you for your help in advance.
>
> Regards
>
> Mary
>
>
This is not Ant related problem.

Check to see which javac and java you're running. (Check your PATH,
and see which java and javac are being picked up). This looks like
you're using a JDK 1.5 library, with a JDK 1.4 VM.

49 is the correct classfile version for 1.5.
If you're getting this error your runtime is 1.4 or earlier while your
compiler is 1.5.

Check again your JAVA_HOME.

-- 
Regards, Petar!
Karlovo, Bulgaria.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org