# - IDEA运行Java示例

# 环境准备

  • Java JDK1.8
  • Apache Tomcat:9.x版本
  • Maven 仓库
  • IDEA 环境

# 运行步骤

  1. 下载Java示例代码

    下载地址:https://api.onlyoffice.com/app_data/editor/Java%20Example.zip
    
    1
  2. 解压Java示例代码

  3. 使用IDEA打开 Java Example文件夹,选择Maven project

  4. 修改配置文件settings.properties参数

    修改files.docservice.url.site地址为自己onlyoffice服务地址

filesize-max=5242880 storage-folder=app_data

files.docservice.viewed-docs=.pdf|.djvu|.xps files.docservice.edited-docs=.docx|.xlsx|.csv|.pptx|.txt files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2 files.docservice.timeout=120000

#files.docservice.url.site=https://documentserver/
files.docservice.url.site=http://192.168.200.118/ files.docservice.url.converter=ConvertService.ashx files.docservice.url.command=coauthoring/CommandService.ashx files.docservice.url.api=web-apps/apps/api/documents/api.js files.docservice.url.preloader=web-apps/apps/api/documents/cache-scripts.html files.docservice.url.example=

files.docservice.secret= files.docservice.header=Authorization




5. 修改maven仓库指向地址

鉴于国内网络导致下载慢问题,建议使用国内源(本人使用的是aliyun)

1
2
3
4
5
6
7
alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central ```
  1. 添加本地提前准备好的Tomcat,选择本地Jdk

  2. 配置TomcatDeployment

  3. 启动Tomcat

上次更新: 2023/12/27