秀娟9710 发表于 2016-5-18 09:46:48

MAC Environment Setting Up(1)Tools of JAVA

MAC Environment Setting Up(1)Tools of JAVA


1. Password Reset

On the first day, I got MAC Pro laptop. But I do not know the password.

So I shutdown my MAC and start the device and immediately after the starting sound, I click on the button 'Shift' to enter the safe boot mode. They I follow the steps their and use the command to change the password of the current user.

>passwd username



2. SSH Key

Use the command ssh to connect to one server, then I can get the directory /Users/username/.ssh

>ssh-keygen -t dsa

I can generate my own key for MAC laptop.



And I can also create a file with other private key, for example, my default private key file is carl_mac and carl_mac.pub. And I created a separate file named other_key, when I try to access to the other server. I will use the command to specify the key file:

>ssh -i other_key username@otherserver.com



certainly, I will give the rights to key file.

>chmod 400 other_key



3. Lock the Screen

How to lock the screen when I leave my mac on my desk.

Use this command'Control'+ 'Shift'+ 'Eject' Eject is the top right button.



Change the configuration in 'Security' ----> 'General' tab and select the 5 seconds as the time interval.



4. Install git and plugins

Download the git software from references git website.



5. Fix the subversion plugin error on Eclipse

Follow the BLOG I had before. But I got error message as follow when I use port command>

Error Message:

Digby-Users-MacBook-Pro-3:code carl$ sudo port install subversion

--->Computing dependencies for subversionError: Unable to execute port: can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?



solution:

I need to wait until I install the xcode. follow this blog: http://www.macports.org/install.php.

But after I installed Xcode. The system asked me for tool 'make'.



Next step I will install make on MAC

Maybe, that is only because I only install Xcode 4.4.1. And I ignore the command line tool. I will install the command line tool too this time.

http://adcdownload.apple.com/Developer_Tools/command_line_tools_os_x_lion_for_xcode__august_2012/command_line_tools_for_xcode_os_x_lion_aug_2012.dmg



It works then. I follow the BLOG I wrote before and go on with these commands:

>sudo port install subversion

>sudo port install subversion-javahlbindings



And we also need to update the SVN plugin to http://subclipse.tigris.org/update_1.8.x

Sometimes, we need to use svn command to update our svn configurations too.
>svn upgrade


5. Install tomcat on MAC

I download the file with name apache-tomcat-7.0.29.tar.gz. And I try to unzip it and move it to working directory.

>tar zxvf apache-tomcat-7.0.29.tar.gz

>sudo mkdir /opt/tool/

>sudo mv apache-tomcat-7.0.29 /opt/tool/



But when I start my tomcat in STS tool, it gives me out of memory error message as follow.

Error Message:

SEVERE: A child container failed during start

java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space

at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:785)



Solution:

Add this configuration to my STS configuration on tomcat, open launch configuration.

-Xms512m -Xmx768m-XX:MaxPermSize=256m



These configuration format and place can be taken JBOSS for example.



6. Install Git on MAC and git plugin on eclipse

http://sillycat.iyunv.com/blog/1323263

http://sillycat.iyunv.com/blog/689970



Just install git on app store. And follow the steps to install edit plugin.



7. Install the sftp client

One of the famous client named filezilla. But it does not support the public/private key pair.



Another nice client is cyberduck. I will try it http://cyberduck.ch/. It is really wonderful to have this tool. And it supports the private/public key pair.



8. Install jboss5.1

I just installed jboss 5.1 as usual. And start the JBOSS server with 80 and 443 port. But I got error message on MAC.

1:01:09,860 INFO The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

01:01:09,975 ERROR Error initializing endpoint

java.net.BindException: Permission denied /0.0.0.0:80

at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:504)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:175)


Solution:

http://www.techyv.com/questions/can-not-start-jboss-port-80

I will use 8080 and 8443 instead.



N. Tips for Installing Some Software

thunder QQ and java in app store





references:

http://sillycat.iyunv.com/blog/1100363

http://osxdaily.com/2011/01/17/lock-screen-mac/

https://distfiles.macports.org/MacPorts/MacPorts-2.0.4-10.7-Lion.dmg

http://sillycat.iyunv.com/blog/1459223
页: [1]
查看完整版本: MAC Environment Setting Up(1)Tools of JAVA