• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Compiling with -source option (K&B7, Chapter 7, page 384)

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
chapter 7, table 7-1
Apparently by now using values of the javac source option below 1.6 result in a warning of
"warning: [options] source value 1.4 is obsolete and will be removed in a future release"
Therefore in the second column of the table for the second and third row actually "Code compiles with warnings" should seem the exact answer
(although this is not related to asserts at all, at some other place the book explicitly calls attention to distinguish between compiles/with warnings/etc answers on the exam)

(This post originated in the K&B7 errata thread)
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

J Deckarm wrote:Apparently by now using values of the javac source option below 1.6 result in a warning of
"warning: [options] source value 1.4 is obsolete and will be removed in a future release"


I tried to reproduce the behavior you described, but I was not successful using JDK 7. When I used JDK 8 to compile my source file, I got the compiler warning. So I assume you are using JDK 8 as well. K&B7 is intended for JDK 7, so it's recommended to use JDK7 to compile and run your code snippets. If you are using JDK 7 and got this warning, please let me know which command (and source file) you used.

I did get another warning when compiling with Java 7It seems to be related with this change in javac when cross-compiling to an older platform. Here you'll find the correct command to cross-compile. I would be very surprised if the option -bootclasspath is on the exam. I even wonder if the -source option is still on the exam. So for JDK7 I think table 7.1 doesn't require a change, but for the next version (JDK8) this table should definitely be revisited (if it's still in the study guide).

Hope it helps!
Kind regards,
Roel
 
J Deckarm
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, indeed I use JDK8. I now checked with JDK7, and experienced the same as you did. I agree with your conclusion too.
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic