After I set JAVA_HOME in my environment, I got this when running PIG:
在我的环境中设置JAVA_HOME后,我在运行PIG时得到了这个:
ubuntu@XXXXXX:~/pig/pig-0.11.1/bin$ export JAVA_HOME=/usr/lib/jvm/java-6-sun
ubuntu@ip-10-117-89-198:~/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)
When I sudo it:
当我sudo它:
ubuntu@ip-10-117-89-198:~/pig/pig-0.11.1/bin$ sudo ./pig
Error: JAVA_HOME is not set.
But in my environment, JAVA_HOME is set:
但是在我的环境中,JAVA_HOME设置为:
ubuntu@ip-10-117-89-198:~/pig/pig-0.11.1/bin$ env | grep java
OLDPWD=/usr/lib/jvm/java-6-sun
JAVA_HOME=/usr/lib/jvm/java-6-sun
Running on: Ubuntu 10.04.4 LTS Java: java version "1.6.0_21" Hadoop version: hadoop-0.20.203 PIG version: pig-0.11.1 ENV: TERM=xterm SHELL=/bin/bash XDG_SESSION_COOKIE=8ae630b8b99d1e6f701be8b54f4baedf-1372165040.445642-2054865008 SSH_CLIENT=XXXXXXXXXXXXXXXXXXXXXXX OLDPWD=/home/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:do=01;35:bd=40;33;01:cd=40;33;01:or=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:.lzma=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:.rm=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
运行于:Ubuntu 10.04.4 LTS Java:java版本“1.6.0_21”Hadoop版本:hadoop-0.20.203 PIG版本:pig-0.11.1 ENV:TERM = xterm SHELL = / bin / bash XDG_SESSION_COOKIE = 8ae630b8b99d1e6f701be8b54f4baedf-1372165040.445642- 2054865008 SSH_CLIENT = XXXXXXXXXXXXXXXXXXXXXXX OLDPWD = / home / 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:DO = 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:流量= 34; 42:ST = 37; 44:前= 01; 32:的.tar = 01; 31:.tgz的= 01; 31:.ARJ = 01; 31: .taz = 01; 31:.LZH = 01; 31:.lzma = 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:.M P4 = 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
1 个解决方案
#1
0
If you don't want to modify the configuration, you can use use sudo -E ./pig
. -E
means passing the environment of current user to the sudo users.
如果您不想修改配置,可以使用sudo -E ./pig。 -E表示将当前用户的环境传递给sudo用户。
#1
0
If you don't want to modify the configuration, you can use use sudo -E ./pig
. -E
means passing the environment of current user to the sudo users.
如果您不想修改配置,可以使用sudo -E ./pig。 -E表示将当前用户的环境传递给sudo用户。