Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How to compile maven web project in different version and run in different version  RSS feed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a maven web project in eclipse. I want to compile it in jdk 1.6 and have its run time environment as 1.8.I have tomcat as the web container to run the project. For compiling I am aware of the Compliance level option in the project settings. Is it the correct way to go about the compile time requirement? And what settings do I have to change to make it run on java 1.8?
 
Saloon Keeper
Posts: 9707
192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You run it on Java 8 by running it on Java 8. I don't want to be glib, but there's not much else to it. If Eclipse uses the regular Tomcat startup scripts, Tomcat will use the JVM that you have configured in the JAVA_HOME environment setting.
 
Marshal
Posts: 62844
203
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

saurabhmehta mehta wrote:. . . . I want to compile it in jdk 1.6 and have its run time environment as 1.8. . . .

Why?

There are options you can access by right‑clicking the project's name in the left window on Eclipse. Compatibility is one of them.
 
Campbell Ritchie
Marshal
Posts: 62844
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively, you can pass command‑line arguments when you run the main method.
 
Stephan van Hulst
Saloon Keeper
Posts: 9707
192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Alternatively, you can pass command‑line arguments when you run the main method.


Web applications don't have a main method.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!