Question:
How can I create a jar file?
Confused
2010-07-14 09:47:56 UTC
I tried creating a jar file using the jar command in the command prompt but I get
"jar is not recognised as an internal or external command, operable program or batch file"..

I viewed various tutorials from the net and got the same technique of passing through command prompt.
But I think my command prompt doesn't support the jar command ...
How can I create a jar file now??

Thanks in adv
Seven answers:
eli porter
2010-07-14 10:12:06 UTC
When you say you have java installed, you mean the java development kit right? just installing the java runtime which is all you need to run java applets is not enough, jar is a program inside of the jdk.



make sure THIS is what you got:

http://java.sun.com/javase/downloads/widget/jdk6.jsp



its about 76mb, the java runtime is much smaller ,like around 10mb



If you're sure you have the JDK, then you must not have jar in your path, do a search on your computer for jar or jar.exe and then from the command line you want to go into that folder and then type jar, then you want to add whatever folder jar is located in to your path so that you can run jar no matter what folder you're in. here's how to add a folder to your path:

http://www.windowsitpro.com/article/configuration/how-can-i-add-a-new-folder-to-my-system-path-.aspx
m scea
2010-07-14 10:07:53 UTC
1) Find the directory where java is installed. Let us assume it is C:\java. Then go to C:\java\bin. If you find jar.exe in this bin directory, then you are good.

2) Set the path to the java bin directory.

3) Then try to type jar in your command prompt.



To set your path: there are several ways.



1) To set it from command prompt, in the command prompt type

SET PATH=%PATH%;C:\java\bin

2) Then hit enter

3) Note: if you have installed java in a different directory type that directory name. I have just provided C:\java as an example.



If you don’t find the jar.exe in your java’s bin directory, then you need to uninstall java and install the JDK (not just the JRE). You need JDK for jar.



You must have a copy of the Java Runtime Environment (JRE) on your system to run Java applications and applets. To develop Java applications and applets, you need the Java Development Kit, which includes the JRE



Here is the link to download java.

http://java.sun.com/javase/downloads/index.jsp
eaford
2016-10-26 12:42:23 UTC
ok, it does no longer locate MySpiffy.important(). you may change that... a million. In NetBeans, the challenge you want is Boldfaced contained in the challenge window. Or, Menu Run, set important challenge 2. back in Run menu, Set challenge Configuration, Customize 3. communication field for 'Run', a textfield for important type with a Browse button, click that Button and navigate to the kind with the important. ok which will upload contained in the MANIF ==> packagename.MySpiffy on your .jar Your jar may run if the instructions weren't interior of a folder, the kit. yet as you progression there is many applications blanketed alongside contained in the important kit (jointly with bitmaps). good success
?
2016-10-25 15:05:02 UTC
ok, it does no longer locate MySpiffy.important(). you may change that... a million. In NetBeans, the challenge you want is Boldfaced contained in the challenge window. Or, Menu Run, set important challenge 2. back in Run menu, Set challenge Configuration, Customize 3. communication field for 'Run', a textfield for important type with a Browse button, click that Button and navigate to the kind with the important. ok which will upload contained in the MANIF ==> packagename.MySpiffy on your .jar Your jar may run if the instructions weren't interior of a folder, the kit. yet as you progression there is many applications blanketed alongside contained in the important kit (jointly with bitmaps). good success
japodguy
2010-07-14 10:00:31 UTC
I can't remember whether or not the jar tool comes with the JDK or JRE. I think you have to have the JDK installed. If you're on windows, which it sounds like you are, you will need to modify your PATH environment variable to include the directory that jar is in. This will usually be something like C:\\bin.
53MalePrison
2010-07-14 10:00:17 UTC
Check your environment variable. Doesn't seem like java install folder is set in your path.
ajay
2010-07-14 09:49:47 UTC
you have to install java for that


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...