ubuntu安装java7

RUN wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u4-b20/jdk-7u4-linux-x64.tar.gz"
RUN mkdir /opt/jdk1.7.0_04
RUN tar zxvf jdk-7u4-linux-x64.tar.gz -C /opt/jdk1.7.0_04
RUN ln -s /opt/jdk1.7.0_04 /opt/java
RUN echo "export JAVA_HOME=/opt/java" >> /root/.bashrc
RUN echo "export PATH=$PATH:/opt/java/bin" >> /root/.bashrc

Java 6或者7 (1.7_79 以下,以上版本jdk会出现不兼容,不支持java1.8)这个比较坑,其实java6也不可以的,只能1.7_79以下的版本。巨坑啊,耗费了好几个小时。

vim /etc/profile
JAVA_HOME=/opt/java
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH

db

CREATE DATABASE IF NOT EXISTS cat default charset utf8

其他配置

RUN mkdir -p /data/appdatas/cat
RUN mkdir -p /data/applogs/cat

##CLONE
RUN git clone https://github.com/dianping/cat.git
RUN cd cat
RUN git checkout mvn-repo
RUN cp -R * ~/.m2/repository

RUN git checkout master
RUN mvn clean install -DskipTests
RUN mvn cat:install

codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...


引用和评论

0 条评论