简体   繁体   English

Play Framework间歇性地尊重JAVA_HOME?

[英]Play Framework intermittently respects JAVA_HOME?

java6 is the default java on our ubuntu box, and I have java7 in another directory with JAVA_HOME pointing at java7. java6是我们ubuntu框上的默认Java,我在另一个目录中有java7,JAVA_HOME指向java7。

Using sudo -E to maintain the JAVA_HOME env variable in a non-Play project folder: 使用sudo -E在非Play项目文件夹中维护JAVA_HOME env变量:

$ sudo -E /usr/share/play/play
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.1.1 (using Java 1.7.0_17 and Scala 2.10.0), http://www.playframework.org

This is not a play application!

Ok great, play is using java 7! 好的,游戏使用的是Java 7! But if you switch to the directory of an actual Play app and run the same command... 但是,如果您切换到实际Play应用的目录并运行相同的命令...

$ sudo -E /usr/share/play/play
[info] Loading project definition from /var/playtest/project

[info] Set current project to playtest (in build file:/var/playtest/)
       _            _
 _ __ | | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play! 2.1.1 (using Java 1.6.0_26 and Scala 2.10.0), http://www.playframework.org

> Type "help play" or "license" for more information.

Now play is starting up with java6. 现在,游戏从java6开始。 What gives, is play starting more shells or something and not maintaining the appropriate JAVA_HOME? 产生的结果是,游戏开始了更多的炮弹或其他事情,而不维护适当的JAVA_HOME吗? How would you configure using non-default jdk installations with sudo for Play? 在Play的sudo中如何使用非默认的jdk安装进行配置?

Edit: I added an 'echo $JAVA_HOME' to the /usr/share/play/play script and it spits out the correct JDK path in both app and non-app folders: '/usr/share/jdk7/bin/java', however java6 still starts up instead of java7 for actual Play projects. 编辑:我在/ usr / share / play / play脚本中添加了一个'echo $ JAVA_HOME',它在应用程序和非应用程序文件夹中吐出了正确的JDK路径:'/ usr / share / jdk7 / bin / java' ,但是对于实际的Play项目,java6仍会启动,而不是java7。

Maybe this is an actual bug I should open a ticket for? 也许这是我应该打开票证的实际错误? Play knows the correct path at the start of execution, but forgets it and starts using default at some point... Play会在执行开始时就知道正确的路径,但会忘记它并在某个时候开始使用默认值...

There's a ticket for this, though it seems to be resolved in March 2012, and Play 2.1.1 has been released this year. 有一张 ,尽管似乎已在2012年3月解决,但Play 2.1.1已于今年发布。 Based on your description it would look like it's not. 根据您的描述,看起来好像不是。

This issue was just marked as fixed at GitHub, woot 这个问题在GitHub上已被标记为已修复,请

https://github.com/playframework/playframework/issues/985 https://github.com/playframework/playframework/issues/985

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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