Common commands on mac for java developers


Start smtp service on mac
Edit file:
sudo vim /System/Library/LaunchDaemons/org.postfix.master.plist.

Add <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/ > before the closing </dict> tag.
Run sudo postfix start.
Check that SMPT is running: telnet localhost 25

The following information appears to indicate success.
telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 your computer name.local ESMTP Postfix

set javahome, the default mac will use the latest jdk, if you don't have set

echo export "JAVA_HOME =\$(/usr/libexec/java_home -v 1.7)" >> ~/.



===================================================
关掉tomcat 进程
http://stackoverflow.com/questions/15236308/how-do-i-kill-this-tomcat-process-in-terminal

pkill -9 -f tomcat

查找tomcat 进程
ps -ef | grep tomcat => Get all processes with tomcat grep
Once we have process details, we pipe it into the part 2 of the script
awk '{print $2}' | xargs kill -9 => Get the second column [Process id] and kill them with -9 option


通用的做法
ps -ef
will list all your currently running processes

| grep tomcat
will pass the output to grep and look for instances of tomcat. Since the grep is a process itself, it is returned from your command. However, your output shows no processes of Tomcat running.
=====================================================



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326541117&siteId=291194637