linux java setup

https://www.cnblogs.com/shihaiming/p/5809553.html
https://www.cnblogs.com/xuliangxing/p/7066913.html
https://www.cnblogs.com/miaocbin/p/7027468.html

--linux本身默认有安装java,不过版本较低.所以需要先卸载再安装.
一.查看Jdk的安装路径:
whereis java --java安装路径.
which java --java执行路径.
echo $JAVA_HOME
echo $PATH
备注:如果是windows中,可以使用:
set java_home:查看JDK安装路径
java -version:查看JDK版本
二、卸载旧版本的JDK:
卸载系统自带的jdk版本:
1.查看自带的jdk:
#rpm -qa|grep gcj
可能看到如下类似的信息:
libgcj-4.1.2-44.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115
java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115
2.卸载java packages.
--使用rpm -e --nodeps 命令删除上面查找的内容:--nodeps为强制卸载
#rpm -e --nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

#rpm -qa | grep java --发现有两个java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115包。
#rpm -e --nodeps java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115
--error: "java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115" specifies multiple packages --报有多个packages错误.
--改用如下语法删除OK.
#yum -y remove java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115

三.重新安装java 1.8
1.download并copy到linux服务器.
--download java:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
#cd /usr
#mkdir java
2.copy到/usr/java目录下,并解压.
#tar -zxvf jdk-8u171-linux-i586.tar.gz
3.修改设置linux环境变量文件.
#vim /etc/profile

export JAVA_HOME=/usr/java/jdk1.8.0_171
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
4.让profile文件环境娈童立即生效.
#source /etc/profile
5.检查java安装情况
#java -version
#javac

6.Talend发email报错:原因是dns未设定正确导致.
Exception in component tSendMail_1
javax.mail.MessagingException: Unknown SMTP host: dgmail.yydg.com.cn;
#vi /etc/resolv.conf
--设置正确的dns ip,因dns server有变更导致.172.17.11.6/7改为172.17.5.182/3.
search localdomain
#nameserver 172.17.11.6
#nameserver 172.17.11.7

nameserver 172.17.5.182
nameserver 172.17.5.183
--network重启.
#service network restart
--ping OK.
#ping dgmail.yydg.com.cn

7.wildFly for linux
https://blog.csdn.net/supermapsupport/article/details/77625079 --example wildfly 10.1 version.
https://www.cnblogs.com/DennyZhao/p/7878098.html --wildfly入门资料.
https://www.cnblogs.com/blueying/p/3989013.html --安装可能碰到的问题.
http://www.cnblogs.com/lgqboke/p/6169332.html --wildfly 10的安装部署
7.1.安装wildfly
将wildfly-10.1.0.Final.tar.gz放到/opt目录下并解压:
tar -zxvf /opt/wildfly-10.1.0.Final.tar.gz
7.2.设置wildfly环境变量:
#vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_171
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export WILDFLY_HOME=/opt/wildfly-10.1.0.Final
export PATH=$PATH:${JAVA_PATH}:$WILDFLY_HOME/bin
7.3.重启环境文件,让上面设定立即生效.
#source /etc/profile
7.4.启动wildfly:
#cd /opt/wildfly-10.1.0.Final/bin/
#./standalone.sh
--出现以下信息表示success:
WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 6138ms -
Started 331 of 577 services (393 services are lazy, passive or on-demand)
7.5.添加用户:
#cd /opt/wildfly-10.1.0.Final/bin/
#./add-user.sh
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
- The password should be different from the username
- The password should not be one of the following restricted values {root, admin, administrator}
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password :
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]:
About to add user 'tos' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'tos' to file '/opt/wildfly-10.1.0.Final/standalone/configuration/mgmt-users.properties'
Added user 'tos' to file '/opt/wildfly-10.1.0.Final/domain/configuration/mgmt-users.properties'
Added user 'tos' with groups to file '/opt/wildfly-10.1.0.Final/standalone/configuration/mgmt-groups.properties'
Added user 'tos' with groups to file '/opt/wildfly-10.1.0.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret value="I3RlYW1jMjAxNg==" />
tos/#teamc2016
7.6.修改xml配置档让其它电脑可以访问,否则只是本机可以访问.
#cd /opt/wildfly-10.1.0.Final/standalone/configuration
#vi standalone.xml
--将xml文件中的127.0.0.1替换成0.0.0.0
7.7查看服务是否启动
#netstat -anput |grep java
7.8.client端无法访问控制台处理:3种方法,注意代理的设置.
a.--将xml文件中的127.0.0.1替换成0.0.0.0
b.--找到<interfaces>标签,将写死的127.0.0.1改为<any-address/>
<interfaces>
<!--<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>-->
<interface name="management">
<!-- Allow all external IP -->
<any-address/>
</interface>
<interface name="public">
<!-- Allow all external IP -->
<any-address/>
</interface>
</interfaces>
c.--如果remote或client端无法访问,则用如下执行.
# sh /opt/wildfly-10.1.0.Final/bin/standalone.sh -b=0.0.0.0


iptables配置学习.
--首先要看一下iptables是否安装了,使用service iptables status或yum info iptables看一下当前状态
#service iptables status
--防火墙拦截25端口导致,配置防火墙,开启25端口.
vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
-A INPUT -i eth2 -p udp -m udp --sport 53 -j ACCEPT
-A OUTPUT -o eth2 -p udp -m udp --dport 53 -j ACCEPT

iptables -A OUTPUT -o eth2 -p udp --dport 53 -j ACCEPT
iptables -A INPUT -i eth2 -p udp --sport 53 -j ACCEPT
service iptables save

service iptables restart
/etc/init.d/iptables restart
--https://www.cnblogs.com/alimac/p/5848372.html
--https://www.cnblogs.com/bangerlee/archive/2013/02/27/2935422.html

http://blog.51cto.com/iminmin/196941
--打开防火墙.
chkconfig iptables on
--关闭防火墙.
chkconfig iptables off
service iptables start
service iptables stop
service iptables restart
--查看本机关于IPTABLES的设置情况
iptables -L -n
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值