This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

On my new Mac

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your .bash_profile in ~.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC 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: 10124
3
Eclipse IDE Mac PPC 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
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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: 10124
3
Eclipse IDE Mac PPC 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?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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: 10124
3
Eclipse IDE Mac PPC 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: 10124
3
Eclipse IDE Mac PPC 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
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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: 10124
3
Eclipse IDE Mac PPC 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.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • 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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • 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: 4678
7
Linux Mac OS X VI Editor
  • 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
Sheriff
Posts: 17278
6
IntelliJ IDE Mac 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic