在Debian软件包中使用Java 7启动 [英] Launch with Java 7 in Debian package
问题描述
Exec = java -jar Application.jar
...这显然是默认的Java安装。我可以指定如下:
Exec = / usr / lib / jvm / java-1.7.0-openjdk-i386 / bin / java -jar Application.jar
...但是我有点疲惫,因为架构i386)位在那里,如果这样改变,那么可能路径将不起作用。
任何想法?还是我试图以错误的方式完成这个?或者上面的方法是否可以工作?
我无法检查Java代码本身,因为显然它不会运行,如果它是错误的版本,所以不能检查任何东西!
您可以尝试解析
/ usr / bin / update-alternatives --query java
在一个postinst钩子并相应地重写你的桌面文件。仍然脏,但稍好一些。
I've created a Debian package for my application that depends on openjdk-7-jre, problem is I also need to ensure it's launched with Java 7 (chances are Java 6 is still the default.) At present I have
Exec=java -jar Application.jar
...which will obviously just take the default Java install. I could specify something like:
Exec=/usr/lib/jvm/java-1.7.0-openjdk-i386/bin/java -jar Application.jar
...but I'm a bit weary because the architecture (i386) bit is in there, and if that changes then presumably the path wouldn't work.
Any ideas? Or am I trying to accomplish this the wrong way? Or will the above approach work after all?
I can't check in the Java code itself since obviously it won't run if it's the wrong version so can't check anything!
You could try to parse the output of
/usr/bin/update-alternatives --query java
in a postinst hook and rewrite your desktop file accordingly. Still dirty, but slightly better.
这篇关于在Debian软件包中使用Java 7启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!