Can't make my jar work after being built with intellij
I am trying to create a jar file from my project in Intellij IDEA and after building the artifact I get the following error:
Error: Could not find or load main class com.trafficmonitoring.MatchPoint
I think that I have built the artifact correctly.
Image showing the contents of the jar
Image showing project structure and Manifest
Image showing how the artifact was generated
Image showing the sbt file
I can also see the MatchPoint class inside the jar as well as the manifest.
Any ideas of what could be going wrong?
The main method looks like this and it is scala/com/trafficmonitoring:
Main method
It has to be said though, that I have several objects with main method inside scala/com/trafficmonitoring but when I create the artifact I clearly select one of them as the main class.
scala intellij-idea sbt
|
show 6 more comments
I am trying to create a jar file from my project in Intellij IDEA and after building the artifact I get the following error:
Error: Could not find or load main class com.trafficmonitoring.MatchPoint
I think that I have built the artifact correctly.
Image showing the contents of the jar
Image showing project structure and Manifest
Image showing how the artifact was generated
Image showing the sbt file
I can also see the MatchPoint class inside the jar as well as the manifest.
Any ideas of what could be going wrong?
The main method looks like this and it is scala/com/trafficmonitoring:
Main method
It has to be said though, that I have several objects with main method inside scala/com/trafficmonitoring but when I create the artifact I clearly select one of them as the main class.
scala intellij-idea sbt
I just tried this with a simple project (github.com/scala/scala-seed.g8) and it works for me: pasteboard.co/HObj9TE.png. We need to see 1) contents of generated JAR 2) Your Intellij artifact setup
– ygor
Nov 21 '18 at 10:58
Also, do you insist on generating the runnable jar by using IntelliJ's artifacts ? SBT's assembly plugin can do the same for you.
– ygor
Nov 21 '18 at 11:01
Actually this question is missing all the crucial information about your problem. What does your build.sbt look like ? How are you generating your jar ? How are you trying to run your jar ?
– Sarvesh Kumar Singh
Nov 21 '18 at 11:07
Screenshot tells us exactly, how he is trying to run the jar. We can also deduce, that he is using IntelliJ jar artifact to generate the jar. But he needs to show us, how the artifact was defined and what are the contents of generated jar
– ygor
Nov 21 '18 at 11:10
I am also able to build a hello world jar but when I try to do the same with my project it doesn't work. And no, it doesn't necessarily need to be generated using IntelliJ but as I am not experienced with sbt I prefer using IntelliJ
– Pablo Jabat
Nov 21 '18 at 11:10
|
show 6 more comments
I am trying to create a jar file from my project in Intellij IDEA and after building the artifact I get the following error:
Error: Could not find or load main class com.trafficmonitoring.MatchPoint
I think that I have built the artifact correctly.
Image showing the contents of the jar
Image showing project structure and Manifest
Image showing how the artifact was generated
Image showing the sbt file
I can also see the MatchPoint class inside the jar as well as the manifest.
Any ideas of what could be going wrong?
The main method looks like this and it is scala/com/trafficmonitoring:
Main method
It has to be said though, that I have several objects with main method inside scala/com/trafficmonitoring but when I create the artifact I clearly select one of them as the main class.
scala intellij-idea sbt
I am trying to create a jar file from my project in Intellij IDEA and after building the artifact I get the following error:
Error: Could not find or load main class com.trafficmonitoring.MatchPoint
I think that I have built the artifact correctly.
Image showing the contents of the jar
Image showing project structure and Manifest
Image showing how the artifact was generated
Image showing the sbt file
I can also see the MatchPoint class inside the jar as well as the manifest.
Any ideas of what could be going wrong?
The main method looks like this and it is scala/com/trafficmonitoring:
Main method
It has to be said though, that I have several objects with main method inside scala/com/trafficmonitoring but when I create the artifact I clearly select one of them as the main class.
scala intellij-idea sbt
scala intellij-idea sbt
edited Nov 21 '18 at 12:19
Pablo Jabat
asked Nov 21 '18 at 10:24
Pablo JabatPablo Jabat
11
11
I just tried this with a simple project (github.com/scala/scala-seed.g8) and it works for me: pasteboard.co/HObj9TE.png. We need to see 1) contents of generated JAR 2) Your Intellij artifact setup
– ygor
Nov 21 '18 at 10:58
Also, do you insist on generating the runnable jar by using IntelliJ's artifacts ? SBT's assembly plugin can do the same for you.
– ygor
Nov 21 '18 at 11:01
Actually this question is missing all the crucial information about your problem. What does your build.sbt look like ? How are you generating your jar ? How are you trying to run your jar ?
– Sarvesh Kumar Singh
Nov 21 '18 at 11:07
Screenshot tells us exactly, how he is trying to run the jar. We can also deduce, that he is using IntelliJ jar artifact to generate the jar. But he needs to show us, how the artifact was defined and what are the contents of generated jar
– ygor
Nov 21 '18 at 11:10
I am also able to build a hello world jar but when I try to do the same with my project it doesn't work. And no, it doesn't necessarily need to be generated using IntelliJ but as I am not experienced with sbt I prefer using IntelliJ
– Pablo Jabat
Nov 21 '18 at 11:10
|
show 6 more comments
I just tried this with a simple project (github.com/scala/scala-seed.g8) and it works for me: pasteboard.co/HObj9TE.png. We need to see 1) contents of generated JAR 2) Your Intellij artifact setup
– ygor
Nov 21 '18 at 10:58
Also, do you insist on generating the runnable jar by using IntelliJ's artifacts ? SBT's assembly plugin can do the same for you.
– ygor
Nov 21 '18 at 11:01
Actually this question is missing all the crucial information about your problem. What does your build.sbt look like ? How are you generating your jar ? How are you trying to run your jar ?
– Sarvesh Kumar Singh
Nov 21 '18 at 11:07
Screenshot tells us exactly, how he is trying to run the jar. We can also deduce, that he is using IntelliJ jar artifact to generate the jar. But he needs to show us, how the artifact was defined and what are the contents of generated jar
– ygor
Nov 21 '18 at 11:10
I am also able to build a hello world jar but when I try to do the same with my project it doesn't work. And no, it doesn't necessarily need to be generated using IntelliJ but as I am not experienced with sbt I prefer using IntelliJ
– Pablo Jabat
Nov 21 '18 at 11:10
I just tried this with a simple project (github.com/scala/scala-seed.g8) and it works for me: pasteboard.co/HObj9TE.png. We need to see 1) contents of generated JAR 2) Your Intellij artifact setup
– ygor
Nov 21 '18 at 10:58
I just tried this with a simple project (github.com/scala/scala-seed.g8) and it works for me: pasteboard.co/HObj9TE.png. We need to see 1) contents of generated JAR 2) Your Intellij artifact setup
– ygor
Nov 21 '18 at 10:58
Also, do you insist on generating the runnable jar by using IntelliJ's artifacts ? SBT's assembly plugin can do the same for you.
– ygor
Nov 21 '18 at 11:01
Also, do you insist on generating the runnable jar by using IntelliJ's artifacts ? SBT's assembly plugin can do the same for you.
– ygor
Nov 21 '18 at 11:01
Actually this question is missing all the crucial information about your problem. What does your build.sbt look like ? How are you generating your jar ? How are you trying to run your jar ?
– Sarvesh Kumar Singh
Nov 21 '18 at 11:07
Actually this question is missing all the crucial information about your problem. What does your build.sbt look like ? How are you generating your jar ? How are you trying to run your jar ?
– Sarvesh Kumar Singh
Nov 21 '18 at 11:07
Screenshot tells us exactly, how he is trying to run the jar. We can also deduce, that he is using IntelliJ jar artifact to generate the jar. But he needs to show us, how the artifact was defined and what are the contents of generated jar
– ygor
Nov 21 '18 at 11:10
Screenshot tells us exactly, how he is trying to run the jar. We can also deduce, that he is using IntelliJ jar artifact to generate the jar. But he needs to show us, how the artifact was defined and what are the contents of generated jar
– ygor
Nov 21 '18 at 11:10
I am also able to build a hello world jar but when I try to do the same with my project it doesn't work. And no, it doesn't necessarily need to be generated using IntelliJ but as I am not experienced with sbt I prefer using IntelliJ
– Pablo Jabat
Nov 21 '18 at 11:10
I am also able to build a hello world jar but when I try to do the same with my project it doesn't work. And no, it doesn't necessarily need to be generated using IntelliJ but as I am not experienced with sbt I prefer using IntelliJ
– Pablo Jabat
Nov 21 '18 at 11:10
|
show 6 more comments
0
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409970%2fcant-make-my-jar-work-after-being-built-with-intellij%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53409970%2fcant-make-my-jar-work-after-being-built-with-intellij%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I just tried this with a simple project (github.com/scala/scala-seed.g8) and it works for me: pasteboard.co/HObj9TE.png. We need to see 1) contents of generated JAR 2) Your Intellij artifact setup
– ygor
Nov 21 '18 at 10:58
Also, do you insist on generating the runnable jar by using IntelliJ's artifacts ? SBT's assembly plugin can do the same for you.
– ygor
Nov 21 '18 at 11:01
Actually this question is missing all the crucial information about your problem. What does your build.sbt look like ? How are you generating your jar ? How are you trying to run your jar ?
– Sarvesh Kumar Singh
Nov 21 '18 at 11:07
Screenshot tells us exactly, how he is trying to run the jar. We can also deduce, that he is using IntelliJ jar artifact to generate the jar. But he needs to show us, how the artifact was defined and what are the contents of generated jar
– ygor
Nov 21 '18 at 11:10
I am also able to build a hello world jar but when I try to do the same with my project it doesn't work. And no, it doesn't necessarily need to be generated using IntelliJ but as I am not experienced with sbt I prefer using IntelliJ
– Pablo Jabat
Nov 21 '18 at 11:10