![]() ![]() Using text editor, such as vi / vim / nano / echoĮcho "export JAVA_HOME=/your/path" > ~/.bash_profile Then you can edit the boot script ~/.bash_profile Touch ~/.bash_profile add your environment variable into your boot script rw-r-r- 1 crifan staff 461B 10 28 2021 /Users/crifan/.bash_profile You are using bash, related boot script is ~/.bash_profile ➜ ~ ls -lh ~/.bash_profile Then make sure you already have your boot script use terminal to add export JAVA_HOME=/your/path to your launch script.look like this (My here is Chinese name: 终端)Ĭan somebody please walk me through the steps to get that to work on OS X Mavericks, assuming no Unix knowhow? Steps to add environment variable in MacOS Simple.StackExhnage sites should be better as you can see if an answer has been agreed to from the number of votes.įor any macOS, normally have built-in a console application, called Terminal So 3 or 4 work if you are calling the program from the command line (or from a program started in the command line but not by open)Īs for programs from the GUI see this questionĪs for internet is full of rubbish - you need to have enough background to understand an article because as you have discovered many assume things or are incorrect. Correct up to OSX 10.7 and the wy to do this for programs called from the Workspace e.g.Totally correct :) Use TextEdit or nano (or emacs). ![]() bashrc and you need to create the file first You understand correctly assuming you are in a sh type shell (e.g.There are several nbash tutorials around. You also need to understand shells and Unix which by your comments you have not fully done. You need to define what you want the enviroment variable set for and what environment you have. ![]() Although there also has been a change in the default shell in 10.2 or 10.3 from tsch to bash. (If you’ve never installed a contextual menu plugin before, you simply drop it into ~/Library/Contextual Menu Items and then log out and log back in.OSX has had only one change re environment variables and that was in Lion where ~/.MacOSX/ist was removed. Choosing this item launches Terminal (or opens a new Terminal window if Terminal is already running) and changes the working directory to the selected folder. My favorite-and a utility I’ve been using for years now-is PyeHouse Development’s Terminal Here Plugin 0.95 ( free), which does exactly what our forums member has requested: After installing Terminal Here Plugin, if you Control/right-click on a folder (or inside an open window) in the Finder, you’ll see a new option in the resulting contextual menu: Open Terminal Here. In fact, there are at least two solutions out there, each of which takes a different approach. As with many OS X “needs,” you’ll find that a clever developer has already provided the solution. Surely there is an easy way to make “Terminal” the handler for folders in OS X, no? Anyone know how?Īs it turns out, it’s even easier than that. Then when you right click on a folder, you see a menu option for “Command Prompt Here…” which will open a command window at that location. Wrote in a forum thread about Rob’s column:ĭoes anyone know how to edit the contextual menus in OS X? In Windows, all you would do is go into the contextual menu for the object type “Folder” and add “cmd” as an appropriate handler (and give it an intuitive name like “Command Prompt Here…”). If you’re a frequent user of Terminal, Rob’s “hint” teaches you how to use these features while also providing a useful tool.īut-you knew there was a “but” coming, right?-if there’s one thing I’ve learned over the years writing Mac Gems, it’s that there’s always a market for an easier, or even just a different, solution. Rob then went on, in typical Mac OS X Hints style, to show you how to create your own solution to this dilemma using Mac OS X’s built-in technologies in this case, a combination of Automator and AppleScript. The solution to that challenge isn’t quite so simple. Most of the time, though, it seems what I want to do is work with the current Finder folder in the Terminal. The Finder will activate with the proper folder opened. (note the trailing dot!) and press Return. That’s actually pretty simple to do-just type open. For example, there are times when I want to open the current Terminal directory in the Finder. As someone who works with the Terminal a lot, I often find myself wanting to do things between the Terminal and the Finder. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |