mac 使用Homebrew安装ActiveMQ

 brew install activemq
 
  • 1

看到如下的结果时候,成功安装了activemq。

localhost:~ lidong$ brew install activemq
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
bit                 gobby               molecule            statik
carrot2             gsmartcontrol       opencoarrays        tarsnap-gui
cnats               gtk-chtheme         orc-tools           terminator
easy-tag            imagemagick@6       source-to-image     todoman
geeqie              klavaro             speexdsp            watchexec
gifcap              mingw-w64-binutils  sqlparse
==> Updated Formulae
abcde                      gradle                     opus
adns                       grafana                    orientdb
afl-fuzz                   groonga                    osc
amazon-ecs-cli             grsync                     osquery
ammonite-repl              gsoap                      packer
ansible                    gtk+                       packetbeat
ansible-cmdb               gtk+3                      pandoc
ant                        h2o                        parallel
antigen                    hana                       pazpar2
apktool                    haproxy                    pbzip2
app-engine-go-64           harfbuzz                   pcsc-lite
arangodb                   heroku                     pdf2htmlex
aria2                      hivemind                   pdfcrack
armor                      htmlcleaner                pdftoedn
arping                     httrack                    pdns
asio                       hunspell                   pev
assh                       hyperscan                  pgformatter
aubio                      icarus-verilog             pgrouting
autotrace                  icoutils                   pius
aws-elasticbeanstalk       ievms                      pkcs11-helper
aws-sdk-cpp                imagemagick                plantuml
awscli                     influxdb                   pngcrush
b2-tools                   innotop                    pod2man
beansdb                    intercal                   poppler
berkeley-db                ios-webkit-debug-proxy ✔   postgrest
bfg                        iperf3                     pre-commit
bib-tool                   irssi                      prips
bibutils                   iso-codes                  prometheus
bind                       jack                       pstoedit
bitlbee                    javarepl                   pulseaudio
bitrise                    jdnssec-tools              purescript
blockhash                  jenkins                    pushpin
bogofilter                 jid                        pwntools
buku                       jigdo                      pyenv
cabal-install              joe                        pyqt5
caddy                      jruby                      qbs
cadubi                     kapacitor                  qcachegrind
caf                        kawa                       qemu
carina                     khal                       qjackctl
cattle                     kibana                     qscintilla2
cdk                        kobalt                     quantlib
certbot                    kotlin                     rabbitmq
clasp                      kubernetes-cli             rancher-cli
cloc                       kubernetes-helm            rancher-compose
cmake                      languagetool               rancid
coffeescript               lastpass-cli               ranger
collectd                   lean-cli                   ripgrep
commandbox                 leptonica                  rocksdb
conan                      lft                        rpm
consul-template            libass                     rswift
coturn                     libcec                     rtags
cromwell                   libcouchbase               rtv
crystal-lang               libdap                     ruby-build
curlpp                     libev                      rust
dar                        libfabric                  sbcl
darcs                      libgcrypt                  sdb
darkice                    libgit2                    serd
datetime-fortran           libgit2-glib               sfk
datomic                    libgosu                    shadowsocks-libev
dbhash                     libgphoto2                 shmcat
dbt                        libgtop                    sip
dbxml                      liblas                     snap7
dcmtk                      libmikmod                  snort
deis                       libmill                    soci
deisctl                    libming                    sops
dependency-check           libmwaw                    sord
diff-pdf                   libosmium                  sourcekitten
diffoscope                 libphonenumber             speedtest_cli
dirt                       libpng                     sphinx-doc
dmd                        libproxy                   sqldiff
dnscrypt-proxy             libsass                    sqlite
docker                     libslax                    sqlite-analyzer
docker-compose             libspectre                 sshguard
docker-machine             libsvm                     sstp-client
docker-machine-nfs         libtasn1 ✔                 stern
docker-machine-parallels   libtiff                    stoken
docker-swarm               libupnp                    stormpath-cli
dockward                   libusb ✔                   svtplay-dl
doitlive                   libvirt                    swaks
dpkg                       libvpx                     swift
dub                        libxc                      swiftformat
duplicity                  libxml2 ✔                  swiftgen
dwarfutils                 lighttpd                   swiftlint
ecl                        link-grammar               swig
eiffelstudio               linkerd                    syncthing
ejabberd                   liquigraph                 synfig
eject                      lmdb                       syntaxerl
elasticsearch              logentries                 tbox
elasticsearch@2.4          logstash                   tcpkali
elixir                     logtalk                    telegraf
elixirscript               lrdf                       terraform
emscripten                 lsyncd                     terragrunt
etcd                       ltc-tools                  thefuck
euca2ools                  lz4                        thrift
extract_url                macvim                     tile38
fabio                      makeself                   tin
fdk-aac                    mariadb                    tintin
fftw                       mcabber                    tippecanoe
filebeat                   mediaconch                 tomcat
flatbuffers                memcached ✔                transcrypt
flow ✔                     memcacheq                  tty-clock
fluent-bit                 mercurial                  ttyd
fontforge                  metaproxy                  tvnamer
fonttools                  metricbeat                 twarc
fossil                     micropython                typescript
fping ✔                    mikutter                   u-boot-tools
fq                         minizip                    udunits
freeswitch                 mktorrent                  unittest-cpp
freetds                    mkvtoolnix                 unrar
fwup                       moc                        unshield
fzf                        mongo-c-driver             vapoursynth
gammu                      mongodb ✔                  vdirsyncer
gcal                       mongoose                   vice
gdb                        mono                       vim
geckodriver                mpd                        wavpack
geoipupdate                mpv                        webalizer
ghc                        msgpack                    weechat
ghostscript                mypy                       whatmp3
ginac                      neofetch                   wireguard-tools
git-cola                   nexus                      xapian
git-lfs                    nghttp2                    xmlrpc-c
git-subrepo                nim                        xonsh
git-test                   no-more-secrets            xqilla
git-tracker                node ✔                     xrootd
giter8                     node-build                 xxhash
gitlab-ci-multi-runner     node@0.12                  xz
gitup                      node@4                     yadm
gitversion                 node@6                     yank
gmime                      nodeenv                    yarn
gnu-cobol                  notmuch                    yash
gnu-sed                    nss                        yaws
gnupg-pkcs11-scd           nvc                        yaz
gnupg2                     nvi                        yle-dl
gnuradio                   open-cobol                 you-get
gnutls                     open-jtalk                 youtube-dl
go                         open-mesh                  zabbix ✔
godep                      open-ocd                   zbar
gofabric8                  openconnect                zeromq
google-java-format         opencore-amr               zimg
gosu                       openshift-cli              zplug
==> Renamed Formulae
eigen32 -> eigen@3.2       scala210 -> scala@2.10     scala211 -> scala@2.11
==> Deleted Formulae
cpp-netlib      dmtx-utils      dynamodb-local  gcc@6           qtplay

==> Using the sandbox
==> Downloading https://www.apache.org/dyn/closer.cgi?path=/activemq/5.14.3/apac
==> Best Mirror http://mirrors.cnnic.cn/apache/activemq/5.14.3/apache-activemq-5
######################################################################## 100.0%
==> Caveats
To have launchd start activemq now and restart at login:
  brew services start activemq
Or, if you don't want/need a background service you can just run:
  activemq start
==> Summary
��  /usr/local/Cellar/activemq/5.14.3: 555 files, 59.7M, built in 1 minute 39 seconds
localhost:~ lidong$ 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169

2.使用activemq –version来查看安装的版本

localhost:~ lidong$ activemq --version
INFO: Loading '/usr/local/Cellar/activemq/5.14.3/libexec//bin/env'
INFO: Using java '/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java'
Java Runtime: Oracle Corporation 1.8.0_92 /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre
  Heap sizes: current=62976k  free=61648k  max=932352k
    JVM args: -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/usr/local/Cellar/activemq/5.14.3/libexec//conf/login.config -Dactivemq.classpath=/usr/local/Cellar/activemq/5.14.3/libexec//conf:/usr/local/Cellar/activemq/5.14.3/libexec//../lib/: -Dactivemq.home=/usr/local/Cellar/activemq/5.14.3/libexec/ -Dactivemq.base=/usr/local/Cellar/activemq/5.14.3/libexec/ -Dactivemq.conf=/usr/local/Cellar/activemq/5.14.3/libexec//conf -Dactivemq.data=/usr/local/Cellar/activemq/5.14.3/libexec//data
Extensions classpath:
  [/usr/local/Cellar/activemq/5.14.3/libexec/lib,/usr/local/Cellar/activemq/5.14.3/libexec/lib/camel,/usr/local/Cellar/activemq/5.14.3/libexec/lib/optional,/usr/local/Cellar/activemq/5.14.3/libexec/lib/web,/usr/local/Cellar/activemq/5.14.3/libexec/lib/extra]
ACTIVEMQ_HOME: /usr/local/Cellar/activemq/5.14.3/libexec
ACTIVEMQ_BASE: /usr/local/Cellar/activemq/5.14.3/libexec
ACTIVEMQ_CONF: /usr/local/Cellar/activemq/5.14.3/libexec/conf
ACTIVEMQ_DATA: /usr/local/Cellar/activemq/5.14.3/libexec/data

ActiveMQ 5.14.3
For help or more information please see: http://activemq.apache.org


 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

3.activemq常用的命令

Tasks:
    browse                   - Display selected messages in a specified destination.
    bstat                    - Performs a predefined query that displays useful statistics regarding the specified broker
    consumer                 - Receives messages from the broker
    create                   - Creates a runnable broker instance in the specified path.
    decrypt                  - Decrypts given text
    dstat                    - Performs a predefined query that displays useful tabular statistics regarding the specified destination type
    encrypt                  - Encrypts given text
    export                   - Exports a stopped brokers data files to an archive file
    list                     - Lists all available brokers in the specified JMX context
    producer                 - Sends messages to the broker
    purge                    - Delete selected destination's messages that matches the message selector
    query                    - Display selected broker component's attributes and statistics.
    start                    - Creates and starts a broker using a configuration file, or a broker URI.
    stop                     - Stops a running broker specified by the broker name.

Task Options (Options specific to each task):
    --extdir <dir>  - Add the jar files in the directory to the classpath.
    --version       - Display the version information.
    -h,-?,--help    - Display this help information. To display task specific help, use Main [task] -h,-?,--help

 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

4.启动activeMQ服务

activemq start
 
  • 1

看到如下信息,就表示已经安装成功

localhost:~ lidong$ activemq start
INFO: Loading '/usr/local/Cellar/activemq/5.14.3/libexec//bin/env'
INFO: Using java '/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: pidfile created : '/usr/local/Cellar/ActiveMQ/5.14.3/libexec//data/activemq.pid' (pid '2402')

 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

然后就可以访问管理web console。在浏览器中输入url: http://localhost:8161/

这里写图片描述

点击 Manager ActiveMQ boker 输入用户名:admin 密码admin

这里写图片描述

看到这个页面,就可以到ActiveMQ 启动成功了。




<think>嗯,用户想用HomebrewMacBook上安装JDK17。首先,我得确认Homebrew本身是否正确安装。如果用户还没安装Homebrew,可能需要先提供安装步骤,不过可能他们已经安装了,所以可能需要先跳过这一步,但如果需要的话,还是要准备好说明。 然后,关于JDK17的安装Homebrew通常有两种方式:直接安装OpenJDK或者使用第三方仓库比如AdoptOpenJDK。不过记得AdoptOpenJDK可能已经迁移到Eclipse Temurin,所以需要检查当前的tap名称是否正确。现在常用的应该是Eclipse Temurin的版本,所以可能需要添加相应的tap。 接下来,步骤应该是先更新Homebrew,确保所有包信息是最新的。然后搜索可用的JDK17包,比如用`brew search openjdk`或者`brew search temurin`,找到正确的版本。安装命令可能是`brew install temurin17`,但需要确认正确的包名。 安装完成后,需要配置环境变量,比如JAVA_HOME,可能需要用到`/usr/libexec/java_home`命令来定位安装路径。然后更新.bash_profile或者.zshrc文件,取决于用户使用的shell类型。还要提醒用户应用更改,比如source文件或者重启终端。 另外,用户可能会遇到权限问题,或者安装后java -version没变化,可能需要检查路径是否正确,或者是否有多个JDK版本存在,需要用`/usr/libexec/java_home -v17 --exec java --version`来验证。可能还需要提醒如何切换不同版本的JDK,使用jenv或者其他工具。 最后,可能有一些常见问题,比如找不到temurin17,这时候需要确认tap是否正确添加,或者Homebrew的版本是否过旧。另外,安装后的路径是否正确,以及如何设置默认使用JDK17。 需要确保步骤清晰,避免用户遗漏任何环节,比如添加tap或者配置环境变量。同时,用简洁的命令行示例,让用户可以直接复制粘贴执行。可能还需要在最后验证安装是否成功,比如运行java -version来检查版本号是否对应JDK17。</think>以下是在 MacBook 上使用 Homebrew 安装 JDK 17 的步骤: --- ### **1. 确保已安装 Homebrew** 如果尚未安装 Homebrew,先通过终端安装: ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` --- ### **2. 添加 OpenJDK Tap(仓库)** 推荐使用 **Eclipse Temurin**(原 AdoptOpenJDK)的 Homebrew 仓库: ```bash brew tap homebrew/cask-versions brew tap homebrew/cask ``` --- ### **3. 安装 JDK 17** 执行以下命令安装 JDK 17: ```bash brew install --cask temurin17 ``` --- ### **4. 验证安装** 安装完成后,检查 Java 版本: ```bash java -version ``` 如果输出类似 `openjdk 17.0.x`,则安装成功。 --- ### **5. 配置环境变量(可选)** 如果需要设置 `JAVA_HOME`,在终端中运行: ```bash echo 'export JAVA_HOME=$(/usr/libexec/java_home -v 17)' >> ~/.zshrc # 适用于 Zsh(macOS Catalina 及之后版本) # 或 echo 'export JAVA_HOME=$(/usr/libexec/java_home -v 17)' >> ~/.bash_profile # 适用于 Bash ``` 然后执行 `source ~/.zshrc` 或 `source ~/.bash_profile` 使配置生效。 --- ### **常见问题** 1. **找不到 `temurin17` 包?** 确保已正确添加 Tap(步骤 2),或更新 Homebrew: ```bash brew update ``` 2. **多版本 JDK 切换** 使用 `/usr/libexec/java_home -v 版本号` 切换版本,例如: ```bash export JAVA_HOME=$(/usr/libexec/java_home -v 17) ``` 3. **安装路径** JDK 默认安装在 `/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home`。 --- 通过以上步骤即可完成 JDK 17 的安装和基础配置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值