When I try to execute my jar file through the command prompt by typing:
java -jar myJar.jar
It returns an error message saying that it can not access the jar file. Why is this? myJar.jar is the exact name of my jar file.
my jar file is MyJar.jar located at C:\Documents and Settings\Josh\My Documents\JAVA Programs.
My Class path is payroll, The jarfile and manifest files are all correct I believe.
I am trying to execute 'payroll' through the command prompt.
The starting prompt needs to be the location of java.exe
No it doesn't. As long as java.exe is on the path you're fine.
And that's not his problem anyway. His problem is a path problem where he can't find a jar he tries to launch.
So all he needs to do is call java with the correct location for the jar, which he doesn't seem capable of doing for some reason.
A beginner's course in using a command prompt might be in order :mrgreen:
Hey. I know this thread is EXTREMELY outdated, but it is still almost at top at google, and I did not find this solution anywhere else online. I just changed the starting prompt location to the folder in which the jar file is located. For example, if your jar file location and name is: C:\Users\Tod\file.jar, you can do two commands:
you could/should have posted that in a new thread. this is what we refer to as a 'dead thread', a thread that is years old, and marked 'solved' almost a decade ago. chances of people reading this are slim.
start a new thread, provide all the information of your specific case, and ask your question there.
^ to answer to the person above me, i happened to find this thread pretty useful and considering how it is decade old but still on google top search for this issue, its amazing, Anyway, thank you guys for all your help.
John: seriously, there is no need at all to revive dead threads. This will still pop-up in google, or by just using the search button on the top right.
If you only consider top-google results as resources, I recommend a different carreer choice.
i am trying to create a library management system which is supposed to be used to store/keep infp for the library and the library members( book title, author, name and picture for borrower and other stuffs). The app has 6 buttons, delete, save, add,previsous,next, and upload( for upload ...
I need to comput and display the sum and average of the cubes of the even natural numbers between 2 and n. Where n is entered by the user. Im stuck on how to average the sum of the cubes. Help Please. This is what I have so far.