Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java Version Compile Mismatch 1.5/1.6(Compiling Against Java 1.6 Even Though Eclipse is Set To Use Java 1.5)
Java Version Compile Mismatch 1.5/1.6 [message #682369] Fri, 10 June 2011 23:45 Go to next message
Dan  is currently offline Dan Friend
Messages: 5
Registered: September 2010
Junior Member
I'm compiling a company project that uses JDBC and is written against Java 1.5. I'm running on Mac OS X 10.6.7. I'm getting an error in a class that extends java.sql.Statement that it does not implement isPoolable(). That requirement appeared in Java 1.6. I rechecked that my Eclipse global setting is set to 1.5 and that my project is set to use the global setting. Anybody know what I might be missing?

Thanks, Dan
Re: Java Version Compile Mismatch 1.5/1.6 [message #682379 is a reply to message #682369] Sat, 11 June 2011 00:41 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
The compiler level doesn't say anything about the API you compile against!

The only possibility is to use a Java 5 JDK to compile against.

Tom

Am 11.06.11 01:45, schrieb Dan:
> I'm compiling a company project that uses JDBC and is written against
> Java 1.5. I'm running on Mac OS X 10.6.7. I'm getting an error in a
> class that extends java.sql.Statement that it does not implement
> isPoolable(). That requirement appeared in Java 1.6. I rechecked that
> my Eclipse global setting is set to 1.5 and that my project is set to
> use the global setting. Anybody know what I might be missing?
>
> Thanks, Dan
Re: Java Version Compile Mismatch 1.5/1.6 [message #683921 is a reply to message #682379] Tue, 14 June 2011 16:47 Go to previous messageGo to next message
Dan  is currently offline Dan Friend
Messages: 5
Registered: September 2010
Junior Member
True enough. I guess I'd assumed that setting the compiler to 1.5 or 1.6 would set the JDK, but apparently it does not. Looking at the global preferences Jave -> Build Path -> Classpath Variables, the JDK entries remains the same when changing the compiler level:

JRE_LIB /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar

So that would seem to confirm that I'm using 1.5 libs, correct? The mystery remains.
Re: Java Version Compile Mismatch 1.5/1.6 [message #683942 is a reply to message #683921] Tue, 14 June 2011 17:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Rich Kulp

JRE_LIB classpath is obsolete and not used normally anymore.

Go to your project and see what Java container it is using. That is the
JRE that the project is using.


--
Thanks,
Rich Kulp
Re: Java Version Compile Mismatch 1.5/1.6 [message #684049 is a reply to message #683921] Tue, 14 June 2011 22:37 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Isn't that you get the compiler error because the method is marked as
@Override?

Tom

Am 14.06.11 18:47, schrieb Dan:
> True enough. I guess I'd assumed that setting the compiler to 1.5 or
> 1.6 would set the JDK, but apparently it does not. Looking at the
> global preferences Jave -> Build Path -> Classpath Variables, the JDK
> entries remains the same when changing the compiler level:
>
> JRE_LIB
> /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar
>
>
> So that would seem to confirm that I'm using 1.5 libs, correct? The
> mystery remains.
Re: Java Version Compile Mismatch 1.5/1.6 [message #688735 is a reply to message #683921] Sat, 25 June 2011 14:35 Go to previous message
Claudio Nieder is currently offline Claudio NiederFriend
Messages: 15
Registered: July 2009
Junior Member
Hi,

In article <it82q2$2to$1@news.eclipse.org>,
Dan <forums-noreply@eclipse.org> wrote:

> /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar

Please make sure you really have a proper 1.5 version of Java. Snow
Leopard by default has

$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/
lrwxr-xr-x 1 root wheel 59 May 30 21:21
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/ ->
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

just for (limited) backward compatibility. If you need to compile
against a proper 1.5 version of the Java SDK you need to install one
yourself.

claudio
Previous Topic:jni problem
Next Topic:Eclipse Plug-in Development Environment Patch for Java 7 Support (BETA) is not applicable
Goto Forum:
  


Current Time: Sat Dec 20 01:49:49 GMT 2014

Powered by FUDForum. Page generated in 0.02249 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software