後,我在我的環境設置JAVA_HOME,我得到這個運行時PIG:JAVA_HOME錯誤運行時PIG
[email protected]:~/pig/pig-0.11.1/bin$ export JAVA_HOME=/usr/lib/jvm/java-6-sun
[email protected]:~/pig/pig-0.11.1/bin$ ./pig
Exception in thread "main" java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1704)
at java.io.File.createTempFile(File.java:1792)
at org.apache.hadoop.util.RunJar.main(RunJar.java:115)
當我須藤它:
[email protected]:~/pig/pig-0.11.1/bin$ sudo ./pig
Error: JAVA_HOME is not set.
但在我的環境中,JAVA_HOME設置:
[email protected]:~/pig/pig-0.11.1/bin$ env | grep java
OLDPWD=/usr/lib/jvm/java-6-sun
JAVA_HOME=/usr/lib/jvm/java-6-sun
運行於:Ubuntu的LTS 10.04.4的Java :Java版本 「1.6.0_21」 的Hadoop版本:Hadoop的0.20.203 PIG版本:豬0.11.1 ENV: TERM = xterm的 SHELL = /斌/慶典 XDG_SESSION_COOKIE = 8ae630b8b99d1e6f701be8b54f4baedf-1372165040.445642-2054865008 SSH_CLIENT = XXXXXXXXXXXXXXXXXXXXXXX OLDPWD = /家庭/ ubuntu SSH_TTY =/dev/pts/0 USER = ubuntu LS_COLORS = rs = 0:di = 01; 34:ln = 01; 36:hl = 44; 37:pi = 40; 33:so = 01; 35 :做= 01; 35:BD = 40; 33; 01:CD = 40; 33; 01:或= 40; 31; 01:SU = 37; 41:SG = 30; 43:CA = 30; 41:TW = 30; 42:ow = 34; 42:st = 37; 44:ex = 01; 32:.tar = 01; 31: .tgz = 01; 31:.arj = 01; 31: .taz = 01; 31:.lzh = 01; 31: .lz ma = 01; 31:.zip = 01; 31: .z = 01; 31:.Z = 01; 31: .dz = 01; 31:.gz = 01; 31: .bz2 = 01; 31:.BZ = 01; 31: .tbz2 = 01; 31:.tz = 01; 31:的.deb = 01; 31:的.rpm = 01; 31:的.jar = 01; 31:.rar = 01; 31:.ace = 01; 31:.zoo = 01; 31:.cpio = 01; 31:.7z = 01; 31: .rz = 01; 31: .jpg = 01; 35: .jpeg = 01; 35:.gif = 01; 35: .bmp = 01; 35:.pbm = 01; 35: .pgm = 01; 35:.ppm格式= 01; 35:的.tga = 01; 35:.xbm = 01; 35: .xpm = 01; 35:.TIF = 01; 35: .TIFF = 01; 35:。 png = 01; 35: .svg = 01; 35:.svgz = 01; 35:.mng = 01; 35:.pcx = 01; 35:.mov = 01; 35:.mpg = 01; 35:.mpeg = 01; 35:.m2v = 01; 35:.mkv = 01; 35:.ogm = 01; 35:.mp4 = 01; 35:.m4v = 01; 35:.mp4v = 01; 35:.vob = 01; 35:.qt = 01; 35:.nuv = 01; 35: .wmv = 01; 35:.ASF = 01; 35:。室= 01; 35:.rmvb = 01; 35: .FLC = 01; 35:.AVI = 01; 35: .FLI = 01; 35:。 flv = 01; 35: .gl = 01; 35:.dl = 01; 35:.xcf = 01; 35:.xwd = 01; 35: .yuv = 01; 35:.axv = 01; 35:.anx = 01; 35:.ogv = 01; 35:.ogx = 01; 35:.aac = 00; 36: .au = 00; 36:.flac = 00; 36:.mid = 00; 36:.midi = 00; 36:.mka = 00; 36:.mp3 = 00; 36:。mpc = 00; 36:.ogg = 00; 36:.ra = 00; 36:.wav = 00; 36:.axa = 00; 36:.oga = 00; 36: .spx = 00; 36:*。xspf = 00; 36: MAIL =/var/mail/ubuntu PATH =/usr/local/sbin:/ usr/local/bin:/ usr/sbin:/ usr/bin:/ sbin :/ bin:/ usr/games:/ usr/local/hadoop/bin PWD =/home/ubuntu/pig JAVA_HOME =/usr/lib/jvm/java-6-sun LANG = en_US.UTF-8 SHLVL = 1 HOME =/home/ubuntu LOGNAME = ubuntu SSH_CONNECTION = XXXXXXXXXXXXXXXXXXXX LESSOPEN = |在/ usr/bin中/ lesspipe%S LESSCLOSE =的/ usr/bin中/ lesspipe%s%S _ =的/ usr/bin中/ env的
它可能不會爲sudo用戶設置。做'sudo env | grep JAVA_HOME'來檢查它是否被設置。 – user568109
正確@ user568109! – user2520218