Why cant i open a JAR?

71 Replies
JavaBot
JavaBotOP16mo ago
This post has been reserved for your question.
Hey @lip! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Peter Rader
Peter Rader16mo ago
Where do you got that jar from?
0x150
0x15016mo ago
the jar doesnt tell java which class its supposed to run you need to either specify the class manually java -cp CurrencyTranslator.jar the.main.Class or get a jar that is properly set up
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Peter Rader
Peter Rader16mo ago
Well, you need to build it different. How do you build it? Maven?
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Peter Rader
Peter Rader16mo ago
You are using mvn package? What is the class name and package of your Main-Methode?
Carter
Carter16mo ago
you could use a maven plugin for building the jar correctly. mvn package on it's own isn't going to make it executable. check out maven-assembly-plugin (https://maven.apache.org/plugins/maven-assembly-plugin/)
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
you add it to your pom.xml if you don't know how plugins work, I suggest learning about that first.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
well do you have a pom.xml?
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
so the usage page walks you through adding the plugin to your pom.xml just read the whole thing and ask any questions if you're stuck
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
because that's the rules lol
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
are you looking for a justification as to why it's there?
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
If you want to use one of the prefabricated assembly descriptors, you configure which descriptor to use with the <descriptorRefs>/<descriptorRef> parameter.
If you want to use one of the prefabricated assembly descriptors, you configure which descriptor to use with the <descriptorRefs>/<descriptorRef> parameter.
it's just semantics the <descriptorRef>jar-with-dependencies</descriptorRef> is a "prefabricated assembly descriptor" and you're just using those tags so the plugin knows that
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
because you haven't installed maven try the maven wrapper in your project instead
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
try it
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
show your manifest tags
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
so can you show that class?
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
ahh so with JavaFx there is an extra step you need to make a new class with a main method and have that call CurrencyTranslator's main method I usually call it Launcher then that would be your main class
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
yes
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
make sure you updated your pom with this as the new class oh I overlooked the fact you're using the command uncorrectly
java -jar [jar-name].jar
java -jar [jar-name].jar
this I think is still a necessary step though
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
run ./mvnw clean package and try again
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
./mvnw the ./ is important
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
hmmm well I guess just use your IDE to run the commands
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
yes
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
the same error? can you show your entire pom.xml file?
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
I don't see anything wrong there. if you're up to sending the entire codebase I can look at it
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
I'm going to send a pull request
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
I created a working fork
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
that's for creating an image it's like to create native images not jars
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
but seriously, merge my fork and you good.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
add me to the project so I can create a pull request and you can merge it I configured it for you my username is Carter907
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
Go to your repository's settings, then to "Manage Access", and click on "Invite teams or people". Enter their GitHub username or email address and send the invitation.
Go to your repository's settings, then to "Manage Access", and click on "Invite teams or people". Enter their GitHub username or email address and send the invitation.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
there I merged it for you now run mvn clean package and run the jar in the target folder I set it to jdk 18 if that's not what you're using. use something different but you have everything you need to create an execuable jar file now.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
what did you do exactly?
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Carter
Carter16mo ago
what is the error? make sure you actually pulled from the remote repository I updated the remote repository
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
JavaBot
JavaBotOP16mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
JavaBot
JavaBotOP16mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?