Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Spring Basics Spring Components and Configuring Our App Adding a Spring Configuration File

Gavin Ralston
Gavin Ralston
28,770 Points

Warnings when executing bootRun

If I change the following line in build.gradle from "1.5" to "1.8":

sourceCompatibility = 1.8

Then I no longer get deprecation warning messages. Which is awesome, but will there be any unintended consequences from setting this "target version"?

1 Answer

Rob Bridges
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 Points

Hey Gavin, nothing that would make us not be able to run our program on our local machine. However some of the sources that we would run a Spring web app on don't have the latest version of java.

So though the code would compile just fine for you, the second you try to use a lambda, which is new to Java 8, or some similar situation, it could crash in their version of the jvm.

That's one of the main consequences I could think about.

Gavin Ralston
Gavin Ralston
28,770 Points

So I'm not really worried about the spring web app having a problem (which hopefully includes a java platform that has at least received public updates in the last 5 or 6 years) so much as the environment it runs in?

Second thought: At the very least, can it be more-or-less safely assumed that at least moving source compatibility to 1.6 would be fine in any instance where your employer/client doesn't constrain you to their dusty, outdated server? That, at least, gets rid of the more stern deprecation warnings...

Rob Bridges
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 Points

Hey Gavin, 1.6 is probably a safe bet, I'm sure that'd be fine.

And you'd be surprised, a friend of mine tried to run an app on his Go Daddy Hosting site, and had to upgrade and pay them for a higher tier, because the cheapest tier only support jvm 1.6.

Java's popular with large scale corporations and projects, so places that aim towards smaller projects, and not something that you'd normally see Java doing, generally tend to only update when they absolutely 100% have to. And sometimes not even then.

smaller companies are very timid and shy of software updates, especially java.

Gavin Ralston
Gavin Ralston
28,770 Points

Totally understand the "Enterprise is cautious" bit. :) Was just surprised to hear that 1.5 is still a thing with....anybody. At least, you know, given the myriad reasons to not be stuck on 1.5/1.6