在编写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@
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@