从Makefile检测Java位置 [英] Detect Java location from Makefile

查看:56
本文介绍了从Makefile检测Java位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个makefile,该文件需要知道Java include目录的位置,因为它使用了jni.h文件.允许Makefile自动检测Linux上Java安装位置的最佳方法是什么?

I have a makefile, which needs to know the location of the Java include directory because it makes use of the jni.h file. What is the best way of allowing the Makefile to auto-detect where Java is installed on Linux?

谢谢,
克里斯

Thanks,
Chris

推荐答案

如何使用

JAVA_HOME=$(shell readlink -f /usr/bin/javac | sed "s:bin/javac::")

改编自: https://serverfault.com/questions/143786/how-to-确定Java家在Debian-Ubuntu上

这篇关于从Makefile检测Java位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆