IntelliJ IDEA License Server 安装使用 Mac篇

时间:2021-03-02 03:19:14

一、下载

IntelliJ IDEA 是Java开发利器,用社区版不爽,干催就用旗舰版,这个是收费的,需要licence。 

如果你资金充足,请自行购买收费版的Idea:https://www.jetbrains.com/idea/buy。

在线激活地址: http://idea.lanyus.com/  或者 https://www.iteblog.com/idea/

本地证书服务器版,压缩包地址:https://pan.baidu.com/s/1coj34G1vVgx9pSqtHhSXWQ

二、安装

1.解压下载后的软件包,根据当前系统的类型,选中对应的程序版本。

2.编辑一个 com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64.plist 文件,文件名称自己定义:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>RunAtLoad</key>
<true/>
<key>Label</key>
<string>com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64</string>
<key>ProgramArguments</key>
<array>
<string>/Users/phpdragon/Server/IntelliJIDEALicenseServer/IntelliJIDEALicenseServer_darwin_amd64</string>
<string>-l</string>
<string>0.0.0.0(绑定的IP地址)</string>
<string>-p</string>
<string>(大于1024的端口号)</string>
<string>-u</string>
<string>phpdragon(显示被激活的用户名)</string>
</array>
</dict>
</plist>
➜  ~ /Users/phpdragon/Server/IntelliJIDEALicenseServer/IntelliJIDEALicenseServer_darwin_amd64 -h   #查看启动参数
Usage of /Users/phpdragon/Server/IntelliJIDEALicenseServer/IntelliJIDEALicenseServer_darwin_amd64:
-l string
bind on host (default "0.0.0.0")
-p int
port (default )
-prolongationPeriod string
prolongationPeriod (default "")
-u string
username (default "ilanyu")

3.红色部分请根据实际部署目录来设置,编辑完毕之后拷贝 com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64.plist 文件至 ~/Library/LaunchAgents/ 目录下。

三、服务管理

1. 加载配置好的.plist文件:

launchctl load  ~/Library/LaunchAgents/com.phpdragon.IntelliJIDEALicenseServer.plist

2.查看配置是否加载生效:

➜  ~ launchctl list | grep IntelliJIDEALicenseServer
21598 -15 com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64

3. 使用 launchctl 命令管理你的服务,使用 -h 参数来获取参数说明帮助。

launchctl start com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64  #启动服务
launchctl stop com.phpdragon.IntelliJIDEALicenseServerDarwinAmd64 #停止服务 launchctl list | grep IntelliJIDEALicenseServer | awk '{print $3}' | xargs launchctl start
launchctl list | grep IntelliJIDEALicenseServer | awk '{print $3}' | xargs launchctl stop

4.检查服务是否启动:

➜  ~ telnet 127.0.0.1
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

或者查看服务进程是否已经启动

ps aux | grep IntelliJIDEALicenseServer | grep -v grep

好了,Mac上的 IntelliJIDEALicenseServer 已经安装好了,并随机启动了,开始激活IntelliJIDEA吧!

window请参考:IntelliJ IDEA 激活 及 License Server 安装使用 Window篇

PS:

https://www.liaoxuefeng.com/article/0013738936043408e14365018e3427eaa09758db0ea90ac000

http://blog.csdn.net/abby_sheen/article/details/7817198

http://www.devdaily.com/mac-os-x/launchd-plist-examples-startinterval-startcalendarinterval
http://www.devdaily.com/mac-os-x/mac-osx-startup-crontab-launchd-jobs