I have a little problem. I am a relatively new Java learner, and I just finished a little project for a friend. I use an IDE, called JCreator, that solves basically all of my needs without ever having to touch the command line. Since all the coding I've done up to this point was for me, it wasn't a problem. However, I now need to create a JAR file so my friend can use it easily.

I did this:
1.) Created a folder with all of the .CLASS files needed, as well as a manifest.txt that contained one line: "Main-Class: DistanceCalc".
2.) Tried and failed to find some apparently java-specific command line
3.) Opened the Windows command line and I found I could use "java" to bring up a few options. However, "jar ...", "java jar ...", "java -(various flags) jar ..." all were failures. That nice little JAR tutorial simply starts with "jar". I could run my program just fine, but I couldn't perform any other options on it. Including compile.

What am I doing wrong? (I'm guesssing step #2 is where I went bad) I think I am on the completely wrong track. If you need me to provide additional information, just ask. Thanks in advance for any help I receive.

Recommended Answers

All 3 Replies

Try this.

From what I can tell, JCreator has build capabilities that should allow you to create the jar within the IDE. After you have learned to create it from the command line (which you definitely should learn to do), you should also learn how to do it with the IDE build capabilities.

Thanks for the help. Turns out it was a path problem, and my manifest file was in a bad format. It is now successfully sitting in an executable jar. Crisis averted...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.