macOS 下的編譯包
如果是使用安裝文件,請查看官網文檔,如果想要部署在已有的tomcat服務下,請查看網頁壓縮包章節。 Web archive.
An alternate way of installing GeoServer on OS X is to use the platform-independent binary. This version is a GeoServer web application bundled inside Jetty, a lightweight and portable application server. It has the advantages of working very similarly across all operating systems and is very simple to set up.
Installation
-
確認已經安裝了JRE環境. GeoServer 需要 Java 8 環境, and the JRE supplied by OS X is not sufficient. For more information, please see the instructions for installing Oracle Java on OS X.
Note
注意:Java 9 目前還不支持!
For more information about Java and GeoServer, please see the section on Java Considerations.
-
在官方網站下載頁面 GeoServer Download page.
-
選擇穩定版本 Stable.
-
選擇編譯包選項.
-
下載后解壓縮到你想要使用的位置
建議使用該位置:
/usr/local/geoserver. -
通過命令行添加環境變量:
echo "export GEOSERVER_HOME=/usr/local/geoserver" >> ~/.profile . ~/.profile -
通過命令行給文件夾添加用戶權限:
sudo chown -R <USERNAME> /usr/local/geoserver/
其中
USER_NAME是當前用戶的名稱 -
進入到安裝目錄,
geoserver/bin並執行startup.sh 腳本:cd geoserver/bin sh startup.sh
Warning
If you encounter the following error during startup, you may have some invalid JAI jars from the default Mac Java install:
java.lang.NoClassDefFoundError: Could not initialize class javax.media.jai.JAI
To fix this error, locate your Java extensions folder (Usually
/System/Library/Java/Extensionsand/or~/Library/Java/Extensions), and delete the following jars:jai_codec-1.1.3.jar jai_core-1.1.3.jar jai_imageio-1.1.jar
If you have upgraded your OS from an older version, you may not have permission to delete these jars. In this case, you will first need to disable System Integrity Protection.
-
打開瀏覽器輸入網址:
http://localhost:8080/geoserver.
如果能夠看到geoserver的logo,說明安裝成功。![]()
GeoServer installed and running successfully
關閉 GeoServer, 可以通過關閉當前命令行窗口,也可以通過執行bin文件夾下的 shutdown.sh 腳本.
卸載:
- 如果geoserver正在運行,請先停止。
- 刪除Geoserver所在的目錄文件夾。
原文地址:https://docs.geoserver.org/stable/en/user/installation/osx_binary.html
