Jar File not loading

0 Jay Deshaun · February 14, 2015
Ok, I guess it's my turn to ask for help relating to Java...

I'm having a problem for some reason and I don't know if it's the Jar File it self or it's my code.

I program using Eclipse for Java.

Now straight to the point; After I finish programming, I basically export my program into a runnable jar file with it including all the required libraries and then I upload it to my site.

After I upload it, I download it to see if it's runnable and I get this error:

Post a Reply


Oldest  Newest  Rating
+1 Paarth Tandon · February 14, 2015
You are going to need to post the code before anyone can help you. Make sure you use the code input tool on the toolbar above the text area. Looks like this: /images/forum/upload/2015-02-14/773a01dbb4b52c3db2ae113d75c38c6f.png
0 Jay Deshaun · February 24, 2015
@Parrth, I don't think it's my code as all it does is creates a window then inserts objects like buttons, and labels to it.

@Sam, I could run it while editing the code with debug, I could run it after exporting it as any option (Package with library, create required folders for libraries, etc...); but after I upload it to my site and then download it, it doesn't work and comes up with that error. Also, How do I run it with command line, I don't really use it often for any programs.
+1 Majid Hussain · February 24, 2015

I guess you are using Windows to use command line to execute your java code do the following;

Open CMD - Go to Run type Cmd.exe

Then you will see a black box type cd this is used to take you to the directory of the folder so if you folder is called tuna you should type cd tuna

Once you have accessed the folder it should indicate this through the left white text changing color then type type dir and this will show all your files eg dir

Then when you see your file in folder type javac which means java compile(I think!) and the name of the file with the .java eg my java file is called tuna.java I type javac tuna.java.

This should complie the code and show any errors and then type java and then your file name eg java tuna Remeber dont put java tuna.java it will not work
0 Jay Deshaun · February 27, 2015
Thanks @Majid,
That's all useful, but the only thing that didn't work for me is the "javac" command.
I typed it in and I get this:

C:\Users\Tashawn\Dropbox\Eclipse\tic-tac-toe-full\src>javac ttt.java
'javac' is not recognized as an internal or external command,
operable program or batch file.

+1 Aaditya Kotkar · March 1, 2015
you have to install the jdk and go to :
C, program files, java, bin.
right click on any one icon and click properties
you get the path to the bin folder. copy that
right click computers
go to advanced system settings and then click environment variables
click new. you'll have to textfields to fill in - name and path.
fill the first one in as 'Path' only. Anything else and it'll get screwed up
then, paste the path in the next textfield
then  click ok for everything (don't close any windows thats a common mistake i made a million times!!!)
then when you type in javac, it'll recognize it and compile your file
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator