How to use java non-standard library on IntelliJ IDEA

I will summarize the problems I had while studying java using IntelliJ IDEA.

Utilization of classes not included in the standard in java

Method 1 Get the source code

Method 2 Get a binary module

** And, in general, you often get a library with multiple classes in a JAR file ** ** However, the library does not work even if I import it normally! **

** This is because java only searches the path specified by the classpath, so there are two solutions **

① Declare in the environment variable CLASSPATH

(2) Add the -cp option when executing commands such as javac.

The main subject is from here

Let's do the above with the GUI of IntelliJ IDEA!

As an exercise, download the commons-logging: classes for easy logging from the Apache Software Foundation site as a zip. You can download commons-logging from here

Then place the extracted files in the same directory.

スクリーンショット 2018-12-13 2.58.02.png It's red and you can see that it can't be used yet. スクリーンショット 2018-12-13 3.05.31.png Right-click and press Add as Library. スクリーンショット 2018-12-13 3.08.12.png

This kind of thing will appear, so select your directory and press OK to complete!

スクリーンショット 2018-12-13 3.10.04.png

You can see that it is working properly. That's it

You may want to try it when a beginner doesn't know how to use / reuse the JAR file for the first time. that's all It was from a novice programmer

Recommended Posts

How to use java non-standard library on IntelliJ IDEA
[Java] How to use Map
[Java] How to use Map
How to use java Optional
How to use java class
[Java] How to use Optional ②
[Java] How to use removeAll ()
[Java] How to use string.format
How to use Java Map
How to use Java variables
[Java] How to use Optional ①
How to use Truth (assertion library for Java / Android)
Notes on how to use regular expressions in Java
How to use Java HttpClient (Get)
[Java] How to update Java on Windows
How to use Java HttpClient (Post)
[Java] How to use join method
How to use Ruby on Rails
How to use Bio-Formats on Ubuntu 20.04
[Processing × Java] How to use variables
[Java] How to use LinkedHashMap class
[JavaFX] [Java8] How to use GridPane
How to use class methods [Java]
[Java] How to use List [ArrayList]
How to use classes in Java?
[Processing × Java] How to use arrays
How to use Java lambda expressions
[Java] How to use Math class
How to use Java enum type
How to check Java installed on Mac
A memorandum on how to use Eclipse
[Java] How to use the File class
[Ruby on Rails] How to use CarrierWave
[Java] How to use the hasNext function
Java Artery-Easy to use unit test library
How to use submit method (Java Silver)
[Java] How to use the HashMap class
[Easy-to-understand explanation! ] How to use Java instance
[Java] How to use the toString () method
Studying how to use the constructor (java)
[Processing × Java] How to use the loop
How to switch Java versions on Mac
How to use Java classes, definitions, import
[Easy-to-understand explanation! ] How to use Java polymorphism
[Java] [Maven3] Summary of how to use Maven3
[Processing × Java] How to use the class
How to use Java Scanner class (Note)
[Ruby on Rails] How to use redirect_to
[Processing × Java] How to use the function
[Ruby on Rails] How to use kaminari
[Easy-to-understand explanation! ] How to use ArrayList [Java]
[Java] How to use the Calendar class
[Java] Learn how to use Optional correctly
[Easy-to-understand explanation! ] How to use Java overload
try-catch-finally exception handling How to use java
[Easy-to-understand explanation! ] How to use Java encapsulation
[IntelliJ IDEA] How to automatically add final when saving a Java file
[Java] How to use FileReader class and BufferedReader class
[Java] How to use Thread.sleep to pause the program
How to use Java framework with AWS Lambda! ??
Notes on how to use each JUnit Rule