开发者

List of common environment variables for cross-platform, Apache Ant, builds

Does anyone have a list of environment variables that are common on Linux, Windows, and OSX that would enable cross-platform, consistent Apache Ant builds?

For example: On OSX you can specify env.HOME and perform file operations from the user's home directory, /Users/michaelprescott. O开发者_开发知识库n Windows, env.HOME isn't available. Instead, you have to specify env.HOMEDRIVE or env.HOMEPATH .


A lot of that is built into Java. Definitely check out user.dir and similar from System.getProperties() which Ant will use.

Here's a list of some of the more interesting ones:

  • file.encoding = MacRoman
  • file.separator = /
  • java.class.path = ./
  • java.class.version = 50.0
  • java.endorsed.dirs = /System/Library/Frameworks/JavaVM.fram...
  • java.ext.dirs = /Library/Java/Extensions:/System/Library/Ja...
  • java.home = /System/Library/Frameworks/JavaVM.framework/Ver...
  • java.io.tmpdir = /var/folders/Kp/KpmOujsB2RWdqE+BYnAOX++++T...
  • java.library.path = .:/Library/Java/Extensions:/System/Libr...
  • java.specification.version = 1.6
  • java.vendor = Apple Inc.
  • java.version = 1.6.0_20
  • line.separator =
  • os.arch = x86_64
  • os.name = Mac OS X
  • os.version = 10.6.3
  • path.separator = :
  • user.country = US
  • user.dir = /private/tmp/properties-test
  • user.home = /Users/dblevins
  • user.language = en
  • user.name = dblevins
  • user.timezone =


You can always run:

$ ant -diagnostics

It will spew a lot of information, that you are looking for, to your console.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜