Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 9239
177
  • 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: 60142
188
  • 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: 60142
188
  • 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: 9239
177
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!