File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes compile error using ant in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "compile error using ant in eclipse" Watch "compile error using ant in eclipse" New topic
Author

compile error using ant in eclipse

billo bailey
Ranch Hand

Joined: Dec 02, 2002
Posts: 50
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


only users lose drugs
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Sounds as if you are using a JDK 1.4 compiler with a Java 5 JDK library...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
billo bailey
Ranch Hand

Joined: Dec 02, 2002
Posts: 50
yep, thanks. Got a bit confused there, sorted it out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: compile error using ant in eclipse