ok this is my issue. I can create the jar file but i have texts attached to it. i dragged my text files into scr and just set the path to "file.txt" instead "C://FOLDER//program//scr" what ever. how can i get it to run on any computer without having to set a path where the text files are. just package it into the program
Thanks man! Works like a treat! There's just one problem.. I'm using the MySQL library, using a method 'Class.forName("com.mysql.jdbc.Driver");' method. When running in Eclipse it works just fine, but it doesn't when I run it from a CMD using "java -jar test.jar".
@jobapi01 Actually... you need to right click and tell it to run with java, not with your unzip program. try that and it should work. if java doesn't appear in the drop down menu, you need to click 'choose default program' and search for the java app there.
i know this comment was posted over a year ago, and that you personally have probably already figured this out by now. this is mainly for passers by in the future who are having the same issue.
I'm sure because is the only class I use. it has the main method.
by the way, there are another way to do this, by means of using Administrator Command Prompt. You need an other kind of file named "manifest.mf", make this with Notepad, and set into the file:
Manifest-Version: 1.0
Main-Class: Calculadora
Class-Path: .
Now you are ready to continue with the command prompt.
this is dumb not everybody uses fucking eclipse to code their stuff
LiottJones 21 hours ago
When i try to open it on another computer i get a error, this is only fot use by the creator.
whitekevin60 1 month ago
Met wat kan je dat openen op je PC?
Als ik het open met Java Platform SE binary gebeurt er niets,
en als ik het open met Kemulator zegt die: "Can not find MIDlet class.
Plz check jad or use -midlet param.
bartziboy 2 months ago
Tried this and It won't load my images.
D4nneee 2 months ago
ok this is my issue. I can create the jar file but i have texts attached to it. i dragged my text files into scr and just set the path to "file.txt" instead "C://FOLDER//program//scr" what ever. how can i get it to run on any computer without having to set a path where the text files are. just package it into the program
jvasquez987 2 months ago
Awesome!!!! I've always wanted to know how to do this... luckily it looks super easy! Thanks!
mrhozer 3 months ago
Thanks it workedddddddddd liked!
gr1mtoy6100 3 months ago
Haha, zie ik toch ineens het woord bureaublad staan!
EpicAglet 3 months ago
Thanks man! Works like a treat! There's just one problem.. I'm using the MySQL library, using a method 'Class.forName("com.mysql.jdbc.Driver");' method. When running in Eclipse it works just fine, but it doesn't when I run it from a CMD using "java -jar test.jar".
Any ideas how to fix this? Thanks!
binkydude 7 months ago
Thanks Dear...
Fayouuu 7 months ago
Thank you, it worked !
silvyoo 9 months ago
Thanks!!
tuntuni1000 1 year ago
Hi .. Thanks a lot... This was good.. But i want to know .. how i import a WSDL file i have and create .jar files related to the WSDL.
Say a scenario. I have a WSDL file and i m giving to my friend. She wants to create jar file based on the WSDL i provided. How to do it.
archanaiyyer 1 year ago
Everything exists for me, except the field to select a main class.
Mrster 1 year ago
mine isnt executable, i did exactly as you did but it still becomes a normal .jar file.
When i double click on it my unzip program opens it. What did i do wrong?
jobapi01 2 years ago
You should go to the settings of your unzipprogram and search for file association. There you should uncheck ".jar".
This video isn't made to explain how to make an executable. Java programs are ".jar" files.
12SamP12 2 years ago
@jobapi01 Actually... you need to right click and tell it to run with java, not with your unzip program. try that and it should work. if java doesn't appear in the drop down menu, you need to click 'choose default program' and search for the java app there.
i know this comment was posted over a year ago, and that you personally have probably already figured this out by now. this is mainly for passers by in the future who are having the same issue.
sup3rphi1 4 months ago
thanx alot u've been a huge help :)
BaybeDoll14 2 years ago
just what i was wondering how to do ! tnx ^^
TheUserWithNoVids 2 years ago
THANKS
Jenga300995 2 years ago
When I try to excecute the .jar, this show me a message, "Could not find the main class: Calculadora. Program will exit." I don't know what to do!!
Italia3o 2 years ago 3
Are you sure you did the step at 1:05 right?
12SamP12 2 years ago
I'm sure because is the only class I use. it has the main method.
by the way, there are another way to do this, by means of using Administrator Command Prompt. You need an other kind of file named "manifest.mf", make this with Notepad, and set into the file:
Manifest-Version: 1.0
Main-Class: Calculadora
Class-Path: .
Now you are ready to continue with the command prompt.
Italia3o 2 years ago
@12SamP12 @12SamP12 yea same thing happened to me. It won't run because of there is no main class.
Thelordberzerker97 1 month ago
nice ill subscirbe
rsfanshow 3 years ago