Can't make my jar work after being built with intellij
up vote
0
down vote
favorite
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
New contributor
Pablo Jabat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
|
show 6 more comments
up vote
0
down vote
favorite
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
New contributor
Pablo Jabat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
|
show 6 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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
New contributor
Pablo Jabat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
New contributor
Pablo Jabat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Pablo Jabat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 2 days ago
New contributor
Pablo Jabat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 days ago
Pablo Jabat
11
11
New contributor
Pablo Jabat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Pablo Jabat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Pablo Jabat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
|
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
|
show 6 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Pablo Jabat is a new contributor. Be nice, and check out our Code of Conduct.
Pablo Jabat is a new contributor. Be nice, and check out our Code of Conduct.
Pablo Jabat is a new contributor. Be nice, and check out our Code of Conduct.
Pablo Jabat is a new contributor. Be nice, and check out our Code of Conduct.
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago