Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

On my new Mac

 
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I today bought the MBP 13" model. This is the older model as it came under a good discount.

Now, I would like to install Java / Maven / Ant / ActiveMQ / Tomcat / Eclipse

For the most it is plain vanilla installation. I downloaded all the softwares that I needed (the zip files) and extracted them to a folder that I created in my Users directory. How do I set the MAVEN_HOME, TOMCAT_HOME, ANT_HOME? JAVA_HOME was automagically set when I installed JDK. Ideas on how to set the other home variables?
 
Marshal
Posts: 67279
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your .bash_profile in ~.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just tried running mvn -version from the terminal. It shows me the version. I did not set anything. This is what I see



When I tried which java, I got the following:



From where are all these coming?

Can you please elaborate on the .bash_profile?
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that Maven and Ant comes pre-installed in Mac OSX. Now how do I overwrite those with the new versions? I just downloaded the zip files and unpacked them to a folder called Softwares that I created in my Users folder.
 
Bear Bibeault
Marshal
Posts: 67279
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The .bash_profile is a shell script that executes when you open a Terminal instance (or start up any bash shell). I tis there you can set up environment variables and aliases.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just noticed that the Java that is already there was from the default OS bundled version. I would like to do a fresh install. I downloaded the jdk dmg file. But when I double clicked it, why the heck Mac OS won't ask me the location that I want to install it?
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Joe Harry wrote:Just noticed that the Java that is already there was from the default OS bundled version. I would like to do a fresh install. I downloaded the jdk dmg file. But when I double clicked it, why the heck Mac OS won't ask me the location that I want to install it?



Because on a Mac there are default locations for Java, and you wouldn't want to put it somewhere else. Also Mac is never up to date on the latest Java as the Java that is supported on a Mac. So currently it is Java 6. I can't install Java 7 on my Mac.

Hope that makes sense.

Mark
 
Bear Bibeault
Marshal
Posts: 67279
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You update Java through the Software Update mechanism (in the "apple"). You don't install it from a .dmg.

There was just an update today, as a matter of fact.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like I mentioned in my post above, I already have Java 7 which came as a default installation with the Mac. But I would like to have it installed on a different location. You guys say that it is impossible to do that which is a bit of letting down. Even though it is a Mac, it is a personal computer and I want to male it personal by installing the softwares that I want.

There should be some ways to do a custom java installation. I would try my luck with google to find any pointers on Java installation on a Mac.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, how do I find if my Mac has a 64 bit or a 32 bit OS?
 
Bear Bibeault
Marshal
Posts: 67279
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Joe Harry wrote:Even though it is a Mac, it is a personal computer and I want to male it personal by installing the softwares that I want.


Good luck with that approach.
 
Mark Spritzler
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, Mac makes it easier by providing Java at a version it supports so that you don't have to worry about it


I already have Java 7 which came as a default installation with the Mac.



Huh??? Apple only supports Java 6 currently. They don't come installed with Java 7. To get 7, you have to go to Oracle.

here are some more info

http://maclord.ozarweb.com/mevzu/install-java-on-mac-lion/

and from here near the bottom
http://www.ewert-technologies.ca/blog/articles/installing-java-on-mac-osx-lion

Java 7 is not yet supported for Mac OS/X, but will be supported by the OpenJDK project.



Really Oracle, as they have a dmg for installing Java.
http://www.seobloggs.com/2012/05/how-to-install-and-uninstall-java-7-for.html

But it will still have you put Java into their special directory. It is just better organized there, in my mind.

Mark
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the post. I would try to follow what's being said in those articles.
 
Rancher
Posts: 4686
7
Mac OS X VI Editor Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the .bashrc and .bash_profile scripts are executed when shells start up.

For some important programs, like NetBeans and the MAMP version of MySql, you need real system-wide environement variables, not shell specific ones.

Official Apple docs:
http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pat Farrell wrote:For some important programs, like NetBeans and the MAMP version of MySql, you need real system-wide environement variables, not shell specific ones.



Ah, yet another reason to add to my "this is why I don't use Netbeans" list.
 
Pat Farrell
Rancher
Posts: 4686
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Gregg Bolinger wrote:Ah, yet another reason to add to my "this is why I don't use Netbeans" list.


You can do that. but it makes sense to me, you start it from the app launcher, not from a shell. Nothing you do in a shell has any impact on other shells or programs started other ways.
IMHO, this is one thing that OS-X does right.
 
Mark Spritzler
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pat Farrell wrote:

Gregg Bolinger wrote:Ah, yet another reason to add to my "this is why I don't use Netbeans" list.


You can do that. but it makes sense to me, you start it from the app launcher, not from a shell. Nothing you do in a shell has any impact on other shells or programs started other ways.
IMHO, this is one thing that OS-X does right.



OMG, I am agreeing with Pat. ;) JK.

Mark
 
It's just a flesh wound! Or a tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!