Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6966863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:14:48+00:00 2026-05-27T16:14:48+00:00

Trying to compile my app against java 1.7 I found what there was a

  • 0

Trying to compile my app against java 1.7 I found what there was a new method added in javax.sql.CommonDataSource (and so in j.s.DataSource) — .getParentLogger(). You can compare CommonDataSource:1.7 with CommonDataSource:1.6

For me this change definitely breaks backward compatibility. For example, my app (which contains implementations of DataSource) even doesn’t compile against 1.7 without changes in code.

By my opinion, it should be very strong reasons for doing this — but I can’t google even one. Can somebody explain the reasoning behind this change? How it’s supposed to deal with it correctly — for me it’s a first time I’ve met with backward uncompatibility with java, so I do not have any “best practices” here…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:14:48+00:00Added an answer on May 27, 2026 at 4:14 pm

    If you’re not ready to support compiling your application for Java 7, you can still compile for Java 1.6 using the Java 7 compiler. You will need a Java 1.6 runtime environment (or SDK) installed. If you try compiling a MyDataSource.java class that implements a stubbed DataSource using a Java 7 compiler, you might see the following:

    $ java -version 
    java version "1.7.0"
    Java(TM) SE Runtime Environment (build 1.7.0-b147)
    Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)
    $ javac -version
    javac 1.7.0
    $ javac MyDataSource.java 
    MyDataSource.java:7: error: MyDataSource is not abstract and does not override abstract method getParentLogger() in CommonDataSource
    public class MyDataSource implements DataSource {
           ^
    1 error
    

    You need to tell the compiler that you want to use source files written for Java 1.6, produce Java 1.6 bytecode and where to find the Java 1.6 runtime JAR:

    $ javac -source 1.6 -target 1.6 -bootclasspath <path to Java 1.6 JRE>/lib/rt.jar MyDataSource.java 
    $ file MyDataSource.class 
    MyDataSource.class: compiled Java class data, version 50.0 (Java 1.6)
    $ javap MyDataSource
    Compiled from "MyDataSource.java"
    public class MyDataSource implements javax.sql.DataSource {
      public MyDataSource();
      public java.io.PrintWriter getLogWriter() throws java.sql.SQLException;
      public void setLogWriter(java.io.PrintWriter) throws java.sql.SQLException;
      public void setLoginTimeout(int) throws java.sql.SQLException;
      public int getLoginTimeout() throws java.sql.SQLException;
      public <T extends java/lang/Object> T unwrap(java.lang.Class<T>) throws java.sql.SQLException;
      public boolean isWrapperFor(java.lang.Class<?>) throws java.sql.SQLException;
      public java.sql.Connection getConnection() throws java.sql.SQLException;
      public java.sql.Connection getConnection(java.lang.String, java.lang.String) throws java.sql.SQLException;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m trying to compile an app developped with ios sdk 4.3 with new
So I am trying to compile legacy app from 32 bit to 64 bit..
I am having problems trying to compile my App to my iPhone. I upgraded
When trying to compile an Expression in a medium trust web app I'm getting
I keep getting an error while trying to compile my C++ app on Mac
I am trying to compile an iPhone app. The app is quite old (2.0
I'm trying to compile an iPhone app that uses CorePlot. I'm using XCode 4.
I am trying to make my JavaFX app compile into a WAR file for
I am trying to compile a simple test app using a library I've written.
I am completely new to objective c. I am trying to compile a very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.