Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Development environment recommended best practices

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a clean install of Mavericks on a new MBP.

I am wanting to install various IDEs, alongside the JDK, Android SDK, Tomcat, Glassfish, Ruby, Rails, Homebrew, Python, Django, PostgreSQL, etc, etc.

What are some best practices to set up a stable, flexible development environment on OS X, in relation to the following considerations (and any extras you can think of)

Install location: ~ (home) vs. / (root) vs. /usr/local
Install methods: Package manager(s) vs. app store vs. build from source vs. pre-built packages
Install preferences: Various places (install stuff with defaults) with symbolic links vs. one directory (/usr/loca/development for example)
Install nice-to-have's: Shell scripts to do stuff? Any tools for organising your development machine better?
 
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Install Homebrew first, and get it to install as many of the other things as possible. For other packages, I like to install them in /opt, based on type and version. So for Tomcat, I might have /opt/tomcat/tomcat-7.0.1 and /opt/tomcat/tomcat-6.3.2. Then I link the version I like the best to "default". So:
ln -s /opt/tomcat/tomcat-7.0.1 /opt/tomcat/default. That way I can put /opt/tomcat/default into PATH statements (etc.) and if I ever need to change versions, I can just link a different Tomcat to default, and everything keeps humming along. You don't need to mess around with editing files or restarting your terminal. I used to do the same thing with Java, but now Macs have their own system for dealing with JDKs, and I've sort of accepted that.

By the way, here's a prompt command I like to use for terminal windows:

export PROMPT_COMMAND='PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'

I found that somewhere, so I just vaguely understand how it works. It shows basic information about your session, but what's cool is it uses green text when the previous command was successful (0 return status) and changes to red if it failed. Gimmicky goodness! Put it into your .bash_profile and you'll see it every time you open a terminal. It looks better on a black background though, so keep that in mind.



 
Marshal
Posts: 67275
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Helpful and informative!

Have a cow.
 
Greg Charles
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear! And, by the way Ashley, welcome to JavaRanch!
 
Ashley Lester
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! Nice tip about the versioning. I'll give that a go.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!