lolibox,一个JAVA图床,以前曾装过这个图床来玩,前段时间看有人问起这个图床的安装问题。趁着有空又装了一遍,顺便记录下安装步骤。转载本文请保留出处。

4L6vB.png

使用的环境:系统是阿里云新加坡的Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-47-generic x86_64)

  • 1.安装JAVA

去官网下载jdk-8u131-linux-x64.tar.gz上传服务器。

mkdir -p /usr/lib/jvm/
tar zxvf jdk-8u131-linux-x64.tar.gz  -C /usr/lib/jvm/
nano /etc/profile
最后加入:
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_131
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH={JAVA_HOME}/bin:$PATH

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_131/bin/java 300
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_131/bin/javac 300
update-alternatives --config java
java  -version
显示:
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
  • 2.安装MAVEN
apt-get install Maven
mvn -version
显示:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.8.0_101/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-36-generic", arch: "amd64", family: "unix"

APT安装不了的话就下载安装:

cd tmp
wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz
tar zxvf apache-maven-3.5.0-bin.tar.gz
cd /opt
mv /tmp/apache-maven-3.5.0 .
cd /bin
ln -s /opt/apache-maven-3.5.0/bin/mvn mvn

mvn -v
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /opt/apache-maven-3.5.0
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.8.0_131/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-47-generic", arch: "amd64", family: "unix"
  • 3.然后就是按着步骤打包了
git clone https://github.com/chocotan/lolibox.git
cd lolibox
mvn clean package
./lolibox-server/target/lolibox-server-x.y.z-SNAPSHOT.jar

PS1:使用mvn clean package -Dmaven.test.skip的话可以跳过测试,不然可能卡在TEST那
PS2: X.Y.Z是版本号,要替换的,前面打包完会生成一个类似lolibox-server-0.2.3-SNAPSHOT.jar这样的JAR包。

项目地址:lolibox