Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
Run PrintVersionInfo.java HttpComponents Core Example
How to run the PrintVersionInfo.java HttpComponents Core Example? I have httpcomponents-core-4.4.6-bin.zip installed.
✍: FYIcenter.com
If you have httpcomponents-core-4.4.6-bin.zip installed, you can follow this tutorial to run the PrintVersionInfo.java HttpComponents Core Example:
1. Open the example program file PrintVersionInfo.java from \fyicenter\httpcomponents-core-4.4.6\examples\org\apache\http\examples\ folder:
/* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * ... */ package org.apache.http.examples; import org.apache.http.util.VersionInfo; /** * Prints version information for debugging purposes. * This can be used to verify that the correct versions of the * HttpComponent JARs are picked up from the classpath. */ public class PrintVersionInfo { /** A default list of module packages. */ private final static String[] MODULE_LIST = { "org.apache.http", // HttpCore "org.apache.http.nio", // HttpCore NIO "org.apache.http.client", // HttpClient }; /** * Prints version information. * * @param args command line arguments. Leave empty to print version * information for the default packages. Otherwise, pass * a list of packages for which to get version info. */ public static void main(String args[]) { String[] pckgs = (args.length > 0) ? args : MODULE_LIST; VersionInfo[] via = VersionInfo.loadVersionInfo(pckgs, null); System.out.println("version info for thread context classloader:"); for (int i=0; i<via.length; i++) System.out.println(via[i]); System.out.println(); // if the version information for the classloader of this class // is different from that for the thread context classloader, // there may be a problem with multiple versions in the classpath via = VersionInfo.loadVersionInfo (pckgs, PrintVersionInfo.class.getClassLoader()); System.out.println("version info for static classloader:"); for (int i=0; i<via.length; i++) System.out.println(via[i]); } }
2. Compile and run the example with Java SE 8 JDK:
\fyicenter\httpcomponents-core-4.4.6\examples>\fyicenter\jdk-1.8.0\bin\javac -cp ..\lib\httpcore-4.4.6.jar org\apache\http\examples\PrintVersionInfo.java \fyicenter\httpcomponents-core-4.4.6\examples>\fyicenter\jdk-1.8.0\bin\java -cp .;..\lib\httpcore-4.4.6.jar org.apache.http.examples.PrintVersionInfo version info for thread context classloader: VersionInfo(org.apache.http:httpcore:4.4.6)@sun.misc.Launcher$AppClassLoader@73d16e93 version info for static classloader: VersionInfo(org.apache.http:httpcore:4.4.6)@sun.misc.Launcher$AppClassLoader@73d16e93
⇒ Run HttpFileServer.java HttpComponents Core Example
⇐ Run ClientChunkEncodedPost.java HttpComponents Client Example
2017-11-02, 1565🔥, 0💬
Popular Posts:
maven-model-builder-3.8. 6.jaris the JAR file for Apache Maven 3.8.6 Model Builder module. Apache Ma...
What JAR files are required to run dom\Writer.java provided in the Apache Xerces package? 3 JAR file...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
JDK 11 jdk.compiler.jmod is the JMOD file for JDK 11 Compiler tool, which can be invoked by the "jav...
JasperReports, the world's most popular open source business intelligence and reporting engine and J...