SORU
25 EYLÜL 2008, PERŞEMBE


OS X ayarı ortam değişkenleri?

OS X YOLU gibi ortam değişkenlerini değiştirmek için doğru yolu nedir? Google'da biraz araştırdım ve 3 farklı dosyalarını düzenlemek için buldu

  • /etc/paths
  • ~/.profil
  • ~/.tcshrc

Hatta bunlardan bazıları bende yok, ve ben çok eminim ki .tcshrc) şimdi bash kullanır beri yanlış. Kimse bu değişkenler, özellikle YOL, tanımlı olduğu hakkında bir fikrin var mı?

Edit: OS X 10.5 koşuyorum

CEVAP
25 ŞUBAT 2009, ÇARŞAMBA


Bruno doğru yolda ilerliyor. Kapsamlı bir araştırma yaptım ve tüm GUI uygulamalarda kullanılabilir değişkenleri ayarlamak istiyorsanız, tek seçenek /etc/launchd.conf

Lütfen environment.plist does not work for applications launched via Spotlight. This is documented by Steve Sexton here unutmayın.

1) bir terminal istemi Açın

2) sudo vi /etc/launchd.conf (not: bu dosya, henüz yok) diye Yazın

3) dosyasına aşağıdaki gibi içeriğini Koymak

# Set environment variables here so they are available globally to all apps
# (and Terminal), including those launched via Spotlight.
#
# After editing this file run the following command from the terminal to update 
# environment variables globally without needing to reboot.
# NOTE: You will still need to restart the relevant application (including 
# Terminal) to pick up the changes!
# grep -E "^setenv" /etc/launchd.conf | xargs -t -L 1 launchctl
#
# See http://www.digitaledgesw.com/node/31
# and http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x/
#
# Note that you must hardcode the paths below, don't use enviroment variables.
# You also need to surround multiple values in quotes, see MAVEN_OPTS example below.
#
setenv JAVA_VERSION 1.6
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
setenv GROOVY_HOME /Applications/Dev/groovy
setenv GRAILS_HOME /Applications/Dev/grails
setenv NEXUS_HOME /Applications/Dev/nexus/nexus-webapp
setenv JRUBY_HOME /Applications/Dev/jruby

setenv ANT_HOME /Applications/Dev/apache-ant
setenv ANT_OPTS -Xmx512M

setenv MAVEN_OPTS "-Xmx1024M -XX:MaxPermSize=512m"
setenv M2_HOME /Applications/Dev/apache-maven

setenv JMETER_HOME /Applications/Dev/jakarta-jmeter

4) VI değişiklikleri Kaydetmek ve Mac yeniden başlatın. Ya kodu grep/xargs komutu show yukarıdaki yorum kullanın.

5) değişkenleri bir Terminal penceresi açıp export yazarak çalışıyor ve yeni değişkenler görmelisiniz Kanıtlamak. Bu da Kişisel olarak sunulacak ve diğer GUI Spot ile başlatmak apps.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Dan Gately

    Dan Gately

    13 AĞUSTOS 2006
  • movies95

    movies95

    27 Kasım 2006
  • Schmittastic Jr.

    Schmittastic

    19 Mart 2013