Bug 25453 - class file has wrong version 48.0, should be 47.0
Summary: class file has wrong version 48.0, should be 47.0
Status: RESOLVED DUPLICATE of bug 15405
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0.1   Edit
Hardware: PC Windows NT
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Darin Swanson CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
: 25817 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-10-28 08:37 EST by MH CLA
Modified: 2005-04-20 09:11 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MH CLA 2002-10-28 08:37:43 EST
I have a ANT build file that works without errors when startet from a dos box 
(cmd.exe). But when I run ANT from Eclipse, my "compile" target fails with the 
following error:

----------
Compiling 25 source files to D:\data\iComps\icf\prg\java\bin\classes
D:\data\iComps\icf\prg\java\src\de\icomps\gui\GuiUtils.java:18: cannot access 
java.lang.Object
bad class file: D:\Programme\j2sdk1.4.0_01\jre\lib\rt.jar
(java/lang/Object.class)
class file has wrong version 48.0, should be 47.0
Please remove or make sure it appears in the correct subdirectory of the 
classpath.
    public static void centerFrame(Frame frame) {
                                   ^
1 error
Build exception: D:\data\iComps\icf\prg\java\build.xml:61: Compile failed, 
messages should have been provided.
Build exception: D:\data\iComps\icf\prg\java\build.xml:61: Compile failed, 
messages should have been provided.
D:\data\iComps\icf\prg\java\build.xml:61: Compile failed, messages should have 
been provided.
	at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:559)
	at org.apache.tools.ant.Task.perform(Task.java:217)
	at org.apache.tools.ant.Target.execute(Target.java:184)
	at org.apache.tools.ant.Target.performTasks(Target.java:202)
	at org.apache.tools.ant.Project.executeTarget(Project.java:601)
	at org.apache.tools.ant.Project.executeTargets(Project.java:560)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run
(InternalAntRunner.java:262)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:233)
	at org.eclipse.ui.externaltools.internal.core.AntFileRunner.execute
(AntFileRunner.java:59)
	at 
org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.executeRunner
(DefaultRunnerContext.java:413)
	at org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.run
(DefaultRunnerContext.java:464)
	at org.eclipse.ui.externaltools.internal.ui.AntLaunchWizard$1.run
(AntLaunchWizard.java:117)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:98)
Build exception: D:\data\iComps\icf\prg\java\build.xml:61: Compile failed, 
messages should have been provided.
-----------

I already played with different JDK settings in Eclispe (1.3, 1.4, with/without 
1.3 LIB, ...) but keep getting this error! Does Eclipse support J2SDK 1.4 at 
all?
Comment 1 Darin Swanson CLA 2002-10-28 12:08:02 EST
Ant in Eclipse works within the same VM that Eclipse was launched on.
What VM are you using to launch Eclipse?
It appears that you have launched Ecilpse on a 1.3.* vm and are attempting to 
compile using a 1.4 library.
Comment 2 MH CLA 2002-10-29 03:00:36 EST
I also started Eclsipe with

eclipse.exe -vm D:\Programme\j2sdk1.4.1_01\bin\java.exe

but it produces the same error ...
Comment 3 Darin Swanson CLA 2002-10-30 10:30:59 EST
I can reproduce your problem if I launch eclipse on a 1.3.* vm and then set the 
javac bootclasspath to use the 1.4.* rt.jar.

If I launch eclipse on a 1.4.* vm with the bootclasspath set to use the 1.4.* 
rt.jar I compile cleanly.

Are you setting a bootclasspath? If so does it work if you do not add the 
rt.jar?
Comment 4 Darin Swanson CLA 2002-11-04 10:43:44 EST
Intend to close this bug report if no further input from bug reporter.
Comment 5 MH CLA 2002-11-05 03:21:02 EST
how do i set a bootclasspath? the problem is, that i have several projects that 
need different JDKs (1.3 and 1.4), so i can't set the JDK globally, I need to 
set it on a project basis. I thought this would be done within the project 
classpath/libs ...
Comment 6 Darin Swanson CLA 2002-11-05 10:16:14 EST
As stated before the current Ant support in eclipse works within the same VM 
that eclipse was launched in.  You cannot selective set the JDK level for a 
project that Ant will use.  You can specify the target ("1.3" or "1.4") for 
your javac task...this is looking more and more like a duplicate of bug 24129.
Comment 7 MH CLA 2002-11-05 11:19:06 EST
hm, then it would be locigal to remove the ant properties in preferences and 
move it to project properties. the ant for this project would then use the 
classpath of this project or (even better) would have its own classpath/path 
setting for this project. :-)
Comment 8 Darin Swanson CLA 2002-11-05 11:25:47 EST
I agree that Ant should be configurable at the project level...see bug 15405.

*** This bug has been marked as a duplicate of 15405 ***
Comment 9 Darin Swanson CLA 2002-11-07 08:43:25 EST
*** Bug 25817 has been marked as a duplicate of this bug. ***