Adding libraries in Intellij Idea











up vote
1
down vote

favorite












I need to add libraries to my project, which are classes in directories, it's not a *.jar file.



I do it in the following way: File -> Project Structure -> Dependencies -> +-> Jar or directories.



But when I add required directory, I get the following result:



enter image description here



What am I doing wrong?










share|improve this question
























  • What libraries do you try to use? It is common to download and use a Java library as a JAR file not as individual classes. Are you really sure you have the compiled class files in your directory and not the Java source files?
    – vanje
    2 days ago






  • 2




    And you should consider to use a build tool like Maven or Gradle which handles the dependencies automatically for you.
    – vanje
    2 days ago










  • @vanje I downloaded from github.com/eclipse/paho.mqtt.java. Everything from this repository
    – Sergei Mikhailovskii
    2 days ago








  • 1




    This is the project's source code. You can not simply download the repository and include the directory as a library in IntelliJ. You first have to build the JARs. See section "Building from source" at the repo page or at the project website. But you should really use Maven in your own project and then you only have to include the dependency in your pom.xml. Of course, you can download the precompiled JAR from Maven Central but then you have to maintain the dependencies on your own.
    – vanje
    2 days ago

















up vote
1
down vote

favorite












I need to add libraries to my project, which are classes in directories, it's not a *.jar file.



I do it in the following way: File -> Project Structure -> Dependencies -> +-> Jar or directories.



But when I add required directory, I get the following result:



enter image description here



What am I doing wrong?










share|improve this question
























  • What libraries do you try to use? It is common to download and use a Java library as a JAR file not as individual classes. Are you really sure you have the compiled class files in your directory and not the Java source files?
    – vanje
    2 days ago






  • 2




    And you should consider to use a build tool like Maven or Gradle which handles the dependencies automatically for you.
    – vanje
    2 days ago










  • @vanje I downloaded from github.com/eclipse/paho.mqtt.java. Everything from this repository
    – Sergei Mikhailovskii
    2 days ago








  • 1




    This is the project's source code. You can not simply download the repository and include the directory as a library in IntelliJ. You first have to build the JARs. See section "Building from source" at the repo page or at the project website. But you should really use Maven in your own project and then you only have to include the dependency in your pom.xml. Of course, you can download the precompiled JAR from Maven Central but then you have to maintain the dependencies on your own.
    – vanje
    2 days ago















up vote
1
down vote

favorite









up vote
1
down vote

favorite











I need to add libraries to my project, which are classes in directories, it's not a *.jar file.



I do it in the following way: File -> Project Structure -> Dependencies -> +-> Jar or directories.



But when I add required directory, I get the following result:



enter image description here



What am I doing wrong?










share|improve this question















I need to add libraries to my project, which are classes in directories, it's not a *.jar file.



I do it in the following way: File -> Project Structure -> Dependencies -> +-> Jar or directories.



But when I add required directory, I get the following result:



enter image description here



What am I doing wrong?







java intellij-idea






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Mikhail Kholodkov

3,48842141




3,48842141










asked 2 days ago









Sergei Mikhailovskii

133




133












  • What libraries do you try to use? It is common to download and use a Java library as a JAR file not as individual classes. Are you really sure you have the compiled class files in your directory and not the Java source files?
    – vanje
    2 days ago






  • 2




    And you should consider to use a build tool like Maven or Gradle which handles the dependencies automatically for you.
    – vanje
    2 days ago










  • @vanje I downloaded from github.com/eclipse/paho.mqtt.java. Everything from this repository
    – Sergei Mikhailovskii
    2 days ago








  • 1




    This is the project's source code. You can not simply download the repository and include the directory as a library in IntelliJ. You first have to build the JARs. See section "Building from source" at the repo page or at the project website. But you should really use Maven in your own project and then you only have to include the dependency in your pom.xml. Of course, you can download the precompiled JAR from Maven Central but then you have to maintain the dependencies on your own.
    – vanje
    2 days ago




















  • What libraries do you try to use? It is common to download and use a Java library as a JAR file not as individual classes. Are you really sure you have the compiled class files in your directory and not the Java source files?
    – vanje
    2 days ago






  • 2




    And you should consider to use a build tool like Maven or Gradle which handles the dependencies automatically for you.
    – vanje
    2 days ago










  • @vanje I downloaded from github.com/eclipse/paho.mqtt.java. Everything from this repository
    – Sergei Mikhailovskii
    2 days ago








  • 1




    This is the project's source code. You can not simply download the repository and include the directory as a library in IntelliJ. You first have to build the JARs. See section "Building from source" at the repo page or at the project website. But you should really use Maven in your own project and then you only have to include the dependency in your pom.xml. Of course, you can download the precompiled JAR from Maven Central but then you have to maintain the dependencies on your own.
    – vanje
    2 days ago


















What libraries do you try to use? It is common to download and use a Java library as a JAR file not as individual classes. Are you really sure you have the compiled class files in your directory and not the Java source files?
– vanje
2 days ago




What libraries do you try to use? It is common to download and use a Java library as a JAR file not as individual classes. Are you really sure you have the compiled class files in your directory and not the Java source files?
– vanje
2 days ago




2




2




And you should consider to use a build tool like Maven or Gradle which handles the dependencies automatically for you.
– vanje
2 days ago




And you should consider to use a build tool like Maven or Gradle which handles the dependencies automatically for you.
– vanje
2 days ago












@vanje I downloaded from github.com/eclipse/paho.mqtt.java. Everything from this repository
– Sergei Mikhailovskii
2 days ago






@vanje I downloaded from github.com/eclipse/paho.mqtt.java. Everything from this repository
– Sergei Mikhailovskii
2 days ago






1




1




This is the project's source code. You can not simply download the repository and include the directory as a library in IntelliJ. You first have to build the JARs. See section "Building from source" at the repo page or at the project website. But you should really use Maven in your own project and then you only have to include the dependency in your pom.xml. Of course, you can download the precompiled JAR from Maven Central but then you have to maintain the dependencies on your own.
– vanje
2 days ago






This is the project's source code. You can not simply download the repository and include the directory as a library in IntelliJ. You first have to build the JARs. See section "Building from source" at the repo page or at the project website. But you should really use Maven in your own project and then you only have to include the dependency in your pom.xml. Of course, you can download the precompiled JAR from Maven Central but then you have to maintain the dependencies on your own.
– vanje
2 days ago



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238424%2fadding-libraries-in-intellij-idea%23new-answer', 'question_page');
}
);

Post as a guest





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238424%2fadding-libraries-in-intellij-idea%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

Florida Star v. B. J. F.

Error while running script in elastic search , gateway timeout

Adding quotations to stringified JSON object values