jar to exe?

I got my jar from netbeans and I was using launch to covert it but idk what to put in jre, wtv I try it doesn't work, it makes the app but it doesn't open... what am I doing wrong pls help 🥺
84 Replies
JavaBot
JavaBot•2mo ago
⌛ This post has been reserved for your question.
Hey @yem! 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.
Defective
Defective•2mo ago
In the JRE Tab you can leave the default JRE Paths and only supply the Min JRE version If you compiled your app with java 8, you set it to 1.8, if you compiled it with Java 9 or newer, you just type the number, so for java 17 it will be just 17
Defective
Defective•2mo ago
No description
Defective
Defective•2mo ago
that should work just fine
yem
yemOP•2mo ago
its 23 but it doesnt work still 😭 what could be the problem?
dan1st
dan1st•2mo ago
What happens?
yem
yemOP•2mo ago
It creates the app but the app doesn't open, neither thru file explorer the executable jar, nor in command line java -jar "jar file path" it says unable to access, i don't know what did I do wrong..
dan1st
dan1st•2mo ago
Did you specify a main class?
yem
yemOP•2mo ago
I don't know but in the manifest file the Class-path in blank, or where should I check if that main class is present?
dan1st
dan1st•2mo ago
There, check the basic tab Does it say anything about a main class? Or something to configure the manifest?
yem
yemOP•2mo ago
Its like this?
No description
dan1st
dan1st•2mo ago
Do you already have a JAR? How did you create it?
yem
yemOP•2mo ago
In main class tab there a space to custom path of it but when added the jar it couldn't proceed it said an error there
dan1st
dan1st•2mo ago
?
yem
yemOP•2mo ago
Yep I have it i created a form in netbeans
dan1st
dan1st•2mo ago
Can you show how you are creating the JAR? not the application code but the JAR creation
yem
yemOP•2mo ago
i created it from the ide with that option is it right?
No description
dan1st
dan1st•2mo ago
Is there a pom.xml? Make sure the main class is set when building the project/generating the JAR
yem
yemOP•2mo ago
theres a build.xml but im not sure where can i make sure the main class is set?
dan1st
dan1st•2mo ago
oh, it's an ant project Is there any way to configure the JAR creation?
yem
yemOP•2mo ago
yepp
dan1st
dan1st•2mo ago
Can you show it?
yem
yemOP•2mo ago
i dont know how...? the code?
dan1st
dan1st•2mo ago
In that case, can you show the build.xml? I thought that was about the second question
yem
yemOP•2mo ago
its what it shows when open~~~
No description
yem
yemOP•2mo ago
i meant yes it is an ant project
dan1st
dan1st•2mo ago
oh that's just for Launch4j
yem
yemOP•2mo ago
yea that lauunch is what created it
dan1st
dan1st•2mo ago
Are you using ant for anything that isn't launch4j? Does that automatically create the JAR?
yem
yemOP•2mo ago
umm wdym? i only used launch4j to compile bc idk another way ive never done it so... yep in the dist folder when i press that clean and build option
dan1st
dan1st•2mo ago
Can you right click on the project? Does that give you a properties option?
yem
yemOP•2mo ago
yes it doess
dan1st
dan1st•2mo ago
Can you click it and show what happens?
yem
yemOP•2mo ago
this
No description
dan1st
dan1st•2mo ago
on the left, click on packaging (below build) what does that show you?
yem
yemOP•2mo ago
like this
No description
dan1st
dan1st•2mo ago
can you open the run category?
yem
yemOP•2mo ago
this~
No description
dan1st
dan1st•2mo ago
Is bday your main class?
yem
yemOP•2mo ago
should i click on the web start? yepp
dan1st
dan1st•2mo ago
no
yem
yemOP•2mo ago
well im not usre but it looks like this on the code?
No description
dan1st
dan1st•2mo ago
And when you tried to view the generated JAR file, it was missing the manifest attribute?
yem
yemOP•2mo ago
no it was the manifiest the only thing in blank was the class path it showed like this Manifest-Version: 1.0 Ant-Version: Apache Ant 1.10.14 Created-By: 23+37-2369 (Oracle Corporation) Class-Path: X-COMMENT: Main-Class will be added automatically by build Main-Class: ishhisbday.bday
dan1st
dan1st•2mo ago
? oh that looks fine Where did you see that?
yem
yemOP•2mo ago
in the manifiest file i opeened the jar with 7zip and look for it
dan1st
dan1st•2mo ago
ok What exactly happens when attempting to run it with java -jar? like the exact error message
yem
yemOP•2mo ago
in cmd it say unable ti access jarfile
dan1st
dan1st•2mo ago
Where are you running java -jar?
yem
yemOP•2mo ago
like this?
No description
dan1st
dan1st•2mo ago
the last command there seems right What do you expect to happen?
yem
yemOP•2mo ago
open the form like an exe? from jar to exe
dan1st
dan1st•2mo ago
Does it open when running from NetBeans?
yem
yemOP•2mo ago
well it doesnt open either just in jar yep thru the ide it does ope open
dan1st
dan1st•2mo ago
Can you show the Java code? ? If it doesn't work in the Jar, there's no point of turning it to an exe
yem
yemOP•2mo ago
then what do i doo why doesnt it open? u mean from file explorer right the jar?
dan1st
dan1st•2mo ago
That's why I asked about your code with the last command you entered in the terminal the command is correct and since it had no output, it probably ran your code which didn't do anything oh wait that was your main class
yem
yemOP•2mo ago
u mean it ran but the code didnt open?
dan1st
dan1st•2mo ago
well it literally does nothing
yem
yemOP•2mo ago
ishhisbday.bday ?
dan1st
dan1st•2mo ago
like you didn't put any code there yeah that's what gets executed when running the JAR and it literally does nothing
yem
yemOP•2mo ago
ig sooo but how to open the form then ?
dan1st
dan1st•2mo ago
idk do you have another main class?
yem
yemOP•2mo ago
no i dont think so
dan1st
dan1st•2mo ago
Like you need some code if you want to open anything
yem
yemOP•2mo ago
the rest are just sub forms what kind of code and where can i put it?
dan1st
dan1st•2mo ago
Did you ever run your application in a way that opened a form?
yem
yemOP•2mo ago
yea at school but this one with my own laptop its the first i try and i cant i followed the same steps it just doesnttt
dan1st
dan1st•2mo ago
First get it to work without a JAR
yem
yemOP•2mo ago
ooh how??
dan1st
dan1st•2mo ago
I think that in school, you had some code in the main class Is that possible? Can you check that code?
yem
yemOP•2mo ago
yea i can i have the files but where in the ide? in which part?
dan1st
dan1st•2mo ago
idk normally you would have to write that code first idk what forms you are talking about But I think you had different code in school Maybe your teachers gave you a template?
yem
yemOP•2mo ago
that jframe on netbeans
dan1st
dan1st•2mo ago
which jframe?
yem
yemOP•2mo ago
nope i did it and i think its pretty similar unless im missing sth idk about u.u swing? that gui to design like addind labels and buttons
dan1st
dan1st•2mo ago
I think your main class code was different in school Can you show that code?
yem
yemOP•2mo ago
u mean the one that end in .java?
dan1st
dan1st•2mo ago
yes
yem
yemOP•2mo ago
this one?
yem
yemOP•2mo ago
No description
JavaBot
JavaBot•2mo 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.
dan1st
dan1st•2mo ago
no
JavaBot
JavaBot•2mo 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.
Want results from more Discord servers?
Add your server