Centos导入rabbitmq Jar包到Java

前端之家收集整理的这篇文章主要介绍了Centos导入rabbitmq Jar包到Java前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在编写RabbitMq的过程中需要引用amqp-client-4.0.0.jar 包@H_404_3@

首先:下载jar包@H_404_3@

root@localhost workspace]# wget http://repo1.maven.org/maven2/com/rabbitmq/amqp-client/4.0.0/amqp-client-4.0.0.jar
@H_404_3@

然后拷贝jar包到jre的扩展目录下:%JRE_HOME%/lib/ext@H_404_3@

[root@localhost workspace]# mv amqp-client-4.0.0.jar /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64/jre/lib/ext/@H_404_3@

@H_404_3@

测试代码:test.java@H_404_3@

import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Channel;@H_404_3@

public class test
{
public static void main( String[]args )@H_404_3@

{
System.out.println("asdfasdfasdfasfd");
}@H_404_3@

}
@H_404_3@

root@localhost workspace]# javac test.java [root@localhost workspace]# java test asdfasdfasdfasfd@H_404_3@

猜你在找的CentOS相关文章