单纯检查 java 可执行是否存在于 $PATH 中?这个不太可靠啊……
这个 java 可能是用户定制的,甚至可能是被 hack 过得。若是由于这个 hack 版本导致的问题被 abrt 捕捉之后还要做特殊处理。
当用户通过仓库安装程序时,默认假设是经过检验的。
若是有个方式能验证系统上 java 环境的可靠性,就没问题了。
个人认为比较可靠的一个方式是寻找在 Oracle Java 和 OpenJDK 中共通的类库文件,检测这个是否存在。
不过这样子就意味着只能识别通过 RPM 方式安装的 Oracle Java 了。
2013/2/25 杜宏羽 <dongfengweixiao(a)gmail.com>:
不是可以声明成依赖于java命令么?然后软件包查询,假如存在命令就认为具有环境。
在 2013-2-25 下午5:34,"Tommy He" <lovenemesis(a)fedoraproject.xn--org>:-0s6m5392c
> 这个是理念问题,Fedora 不允许主仓库里的软件在打包时依赖某闭源产品,况且 Oracle 的 Java 也不在 Fedora 仓库里。
>
> 至于能不能在打包时依赖关系填写成动态的,比如只是检测某个 Oracle Java 和 OpenJDK
> 共用的库是否存在?或者说是否有个可靠、简便的方式去检测系统中是否安装了 Java ?
>
> 据我所知似乎木有哦……
>
> 2013/2/25 Christopher Meng <cickumqt(a)gmail.com>:
> > 因为 Fedora 不想惹上麻烦。
> >
> >
> >
> > *Yours sincerely,*
> > *Christopher Meng*
> >
> > Got problems with Windows? - ReBoot
> > Got problems with Linux? - Be Root
> >
> > Ambassador/Contributor of Fedora Project and many others.
> >
http://cicku.me
> >
> >
> > 2013/2/25 杜宏羽 <dongfengweixiao(a)gmail.com>
> >
> >> 但是你可以自己下载安装。一般来说只要是满足了一个JAVA 的环境就可以,而没有必要限定在只能使用openJAVA啊。
> >> ubuntu和arch 都是如此操作的。
> >> 在 2013-2-25 下午5:21,"Christopher Meng"
<cickumqt(a)gmail.xn--com>:-0s6m5392c
> >>
> >> > Oracle 的 JAVA 是不可能出现的。
> >> >
> >> >
> >> >
> >> > *Yours sincerely,*
> >> > *Christopher Meng*
> >> >
> >> > Got problems with Windows? - ReBoot
> >> > Got problems with Linux? - Be Root
> >> >
> >> > Ambassador/Contributor of Fedora Project and many others.
> >> >
http://cicku.me
> >> >
> >> >
> >> > 2013/2/25 杜宏羽 <dongfengweixiao(a)gmail.com>
> >> >
> >> > > rt
> >> > > 对于这个问题我一直都很不解
> >> > > 为什么fedora 在包的依赖里面需要定义JAVA 环境完全的等于open JAVA 呢?就算是使用了乌龟壳的JAVA
> >> > > 也不行?!而其他的发新版,诸如ubuntu,arch都不会如此。
> >> > > --
> >> > > Fedora中文郵件列表:
>
https://admin.fedoraproject.org/mailman/listinfo/chinese
> >> > >
> >> >
> >> > --
> >> >
Fedora中文郵件列表:https://admin.fedoraproject.org/mailman/listinfo/chinese
> >> >
> >> >
> >> --
> >>
Fedora中文郵件列表:https://admin.fedoraproject.org/mailman/listinfo/chinese
> >>
> >
> > --
> >
Fedora中文郵件列表:https://admin.fedoraproject.org/mailman/listinfo/chinese
> >
>
>
>
> --
> Take a Deep Breath out of Windows
>
>
https://fedoraproject.org/wiki/User:Lovenemesis
> --
>
Fedora中文郵件列表:https://admin.fedoraproject.org/mailman/listinfo/chinese
>
--
Fedora中文郵件列表:https://admin.fedoraproject.org/mailman/listinfo/chinese