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
⌛
This post has been reserved for your question.
Hey @yem! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
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 17that should work just fine
its 23 but it doesnt work still 😠what could be the problem?
What happens?
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..
Did you specify a main class?
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?
There, check the basic tab
Does it say anything about a main class?
Or something to configure the manifest?
Its like this?
Do you already have a JAR? How did you create it?
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
?
Yep I have it i created a form in netbeans
Can you show how you are creating the JAR?
not the application code but the JAR creation
i created it from the ide with that option is it right?
Is there a pom.xml?
Make sure the main class is set when building the project/generating the JAR
theres a build.xml but im not sure where can i make sure the main class is set?
oh, it's an ant project
Is there any way to configure the JAR creation?
yepp
Can you show it?
i dont know how...?
the code?
In that case, can you show the build.xml?
I thought that was about the second question
its what it shows when open~~~
i meant yes it is an ant project
oh that's just for Launch4j
yea that lauunch is what created it
Are you using ant for anything that isn't launch4j?
Does that automatically create the JAR?
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
Can you right click on the project? Does that give you a properties option?
yes it doess
Can you click it and show what happens?
this
on the left, click on packaging (below build)
what does that show you?
like this
can you open the run category?
this~
Is
bday
your main class?should i click on the web start?
yepp
no
well im not usre but it looks like this on the code?
And when you tried to view the generated JAR file, it was missing the manifest attribute?
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
?
oh that looks fine
Where did you see that?
in the manifiest file
i opeened the jar with 7zip and look for it
ok
What exactly happens when attempting to run it with
java -jar
?
like the exact error messagein cmd it say unable ti access jarfile
Where are you running java -jar?
like this?
the last command there seems right
What do you expect to happen?
open the form
like an exe? from jar to exe
Does it open when running from NetBeans?
well it doesnt open either just in jar
yep thru the ide it does ope
open
Can you show the Java code?
?
If it doesn't work in the Jar, there's no point of turning it to an exe
then what do i doo why doesnt it open?
u mean from file explorer right the jar?
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
u mean it ran but the code didnt open?
well it literally does nothing
ishhisbday.bday ?
like you didn't put any code there
yeah that's what gets executed when running the JAR
and it literally does nothing
ig sooo but how to open the form then ?
idk do you have another main class?
no i dont think so
Like you need some code if you want to open anything
the rest are just sub forms
what kind of code and where can i put it?
Did you ever run your application in a way that opened a form?
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
First get it to work without a JAR
ooh how??
I think that in school, you had some code in the main class
Is that possible?
Can you check that code?
yea i can i have the files but where in the ide? in which part?
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?
that jframe on netbeans
which jframe?
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
I think your main class code was different in school
Can you show that code?
u mean the one that end in .java?
yes
this one?
💤
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.
no
💤
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.