简体   繁体   中英

Heroku run java version “1.6.0_27”?

I configured my system.properties file with:

java.runtime.version=1.7
maven.version=3.0.5

Because when I run the command by terminal:

$> heroku run java -version

displays:

$ heroku run java -version 
Running `java -version` attached to terminal... up, run.4610
Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.4) (Ubuntu build 1.6.0_27-b27)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Because Heroku is displaying version 6 of Java that being conifgured in the system.properties file. How to force it to use version 7 of java?

After much work, I could understand why the heroku was going back to version 6 of the Java 1.6.0_27.

It was the heroku plugin for Jenkins to build my application reset the buildpack to version 6 of Java.

Steps to my solution:

  1. Uninstall heroku plugin for Jenkins (currently in beta)
  2. Check the cedar of heroku with the command: heroku --apps:info
  3. Install cedar-14 with support for version 7 of java
  4. Set the build of heroku without the plugin and use maven to deploy in heroku

I hope I can help people who are having the same problem.

And I would like to thank also the codefinger for help. Your help was essential so I could solve the problem. Thank you very much!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM