• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compile error using ant in eclipse

 
billo bailey
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm new to ANT and relatively new to eclipse. I found an online tutorial which I followed but when it comes to testing my first ant build I get the following error:

[javac] Compiling 1 source file to C:\Program Files\eclipse\eclipse\workspace\TestAnt\build
[javac] C:\Program Files\eclipse\eclipse\workspace\TestAnt\src\Test.java:5: cannot access java.lang.Object
[javac] bad class file: C:\Program Files\Java\jre1.5.0\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] public static void main(String[] args) {
[javac] ^
[javac] 1 error

I think its down to the path but I have tried changing it to use an older sdk and still no joy. Can anyone help.

Here's some of my configuration details taken from eclipse v3.0:

*** System properties:
awt.toolkit=sun.awt.windows.WToolkit
catalina.base=/c:/Program Files/eclipse/eclipse/plugins/org.eclipse.tomcat_4.1.30/
catalina.home=/c:/Program Files/eclipse/eclipse/plugins/org.eclipse.tomcat_4.1.30/
catalina.useNaming=true
eclipse.application=org.eclipse.ui.ide.workbench
eclipse.buildId=M200409161125
eclipse.commands=-os
win32
-ws
win32
-arch
x86
-showsplash
C:\Program Files\eclipse\eclipse\eclipse.exe -showsplash 600
-exitdata
C:\Program Files\eclipse\eclipse\eclipse.exe -exitdata ae4_44
-vm
C:\WINNT\system32\javaw.exe

eclipse.product=org.eclipse.platform.ide
eclipse.startTime=1108464319299
eclipse.vm=C:\WINNT\system32\javaw.exe
eclipse.vmargs=-cp
C:\Program Files\eclipse\eclipse\startup.jar
org.eclipse.core.launcher.Main

eof=eof
file.encoding=Cp1252
file.encoding.pkg=sun.io
file.separator=\
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.awt.printerjob=sun.awt.windows.WPrinterJob
java.class.path=C:\Program Files\eclipse\eclipse\startup.jar
java.class.version=49.0
java.endorsed.dirs=C:\Program Files\Java\jre1.5.0\lib\endorsed
java.ext.dirs=C:\Program Files\Java\jre1.5.0\lib\ext
java.home=C:\Program Files\Java\jre1.5.0
java.io.tmpdir=C:\DOCUME~1\biddy\LOCALS~1\Temp\
java.library.path=C:\WINNT\system32;.;C:\WINNT\system32;C:\WINNT;C:\Perl\bin\;C:\CBuilderX\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\jdk131\bin; ;C:\Program Files\Rational\common;C:\CBuilderX\bin;C:\j2sdk1.4.1_03\bin; C:\;
java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
java.naming.factory.url.pkgs=org.apache.naming
java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version=1.5.0-b64
java.specification.name=Java Platform API Specification
java.specification.vendor=Sun Microsystems Inc.
java.specification.version=1.5
java.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
java.version=1.5.0
java.vm.info=mixed mode, sharing
java.vm.name=Java HotSpot(TM) Client VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Sun Microsystems Inc.
java.vm.specification.version=1.0
java.vm.vendor=Sun Microsystems Inc.
java.vm.version=1.5.0-b64
line.separator=

org.eclipse.jdt.debug.ui.scrapbookActive=false
org.osgi.framework.executionenvironment=
org.osgi.framework.language=en
org.osgi.framework.os.name=Windows2000
org.osgi.framework.os.version=5.0
org.osgi.framework.processor=x86
org.osgi.framework.vendor=Eclipse
org.osgi.framework.version=1.2.0
os.arch=x86
os.name=Windows 2000
os.version=5.0
osgi.arch=x86
osgi.bundles=org.eclipse.core.runtime@2:start, org.eclipse.update.configurator@3:start
osgi.bundles.defaultStartLevel=4
osgi.bundlestore=c:\Program Files\eclipse\eclipse\configuration\org.eclipse.osgi\bundles
osgi.configuration.area=file:/c:/Program Files/eclipse/eclipse/configuration/
osgi.framework=file:/c:/Program Files/eclipse/eclipse/plugins/org.eclipse.osgi_3.0.1/
osgi.framework.beginningstartlevel=1
osgi.framework.version=3.0.0
osgi.frameworkClassPath=core.jar, console.jar, osgi.jar, resolver.jar, defaultAdaptor.jar, eclipseAdaptor.jar
osgi.install.area=file:/c:/Program Files/eclipse/eclipse/
osgi.instance.area=file:/C:/Program Files/eclipse/eclipse/workspace/
osgi.logfile=C:\Program Files\eclipse\eclipse\workspace\.metadata\.log
osgi.manifest.cache=c:\Program Files\eclipse\eclipse\configuration\org.eclipse.osgi\manifests
osgi.nl=en_IE
osgi.os=win32
osgi.splashLocation=c:\Program Files\eclipse\eclipse\plugins\org.eclipse.platform_3.0.1\splash.bmp
osgi.splashPath=platform:/base/plugins/org.eclipse.platform
osgi.ws=win32
path.separator=;
sun.arch.data.model=32
sun.boot.class.path=C:\Program Files\Java\jre1.5.0\lib\rt.jar;C:\Program Files\Java\jre1.5.0\lib\i18n.jar;C:\Program Files\Java\jre1.5.0\lib\sunrsasign.jar;C:\Program Files\Java\jre1.5.0\lib\jsse.jar;C:\Program Files\Java\jre1.5.0\lib\jce.jar;C:\Program Files\Java\jre1.5.0\lib\charsets.jar;C:\Program Files\Java\jre1.5.0\classes
sun.boot.library.path=C:\Program Files\Java\jre1.5.0\bin
sun.cpu.endian=little
sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
sun.desktop=windows
sun.io.unicode.encoding=UnicodeLittle
sun.jnu.encoding=Cp1252
sun.management.compiler=HotSpot Client Compiler
sun.net.client.defaultConnectTimeout=60000
sun.net.client.defaultReadTimeout=60000
sun.os.patch.level=Service Pack 4
user.country=IE
user.dir=C:\Program Files\eclipse\eclipse
user.home=C:\Documents and Settings\biddy

Thanks
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds as if you are using a JDK 1.4 compiler with a Java 5 JDK library...
 
billo bailey
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yep, thanks. Got a bit confused there, sorted it out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic