This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Finally, if you used the installer to install Java on your system (which is likely), then all you have to do is double-click the .jar file; the installer maps the .jar extension to the javaw executable.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Joined: Sep 17, 2004
Well, it almost goes when I double click, but I get a failed to load main-class manifest blah blah error.
Works fine from cp. I tried adding the command line attributes to the shortcut, same thing. Heres a copy of my command and also the attributes to make it run in cp. What have I done wrong?
"C:\Documents and Settings\Melissa\Desktop\aol emails\pfcview.jar" doesnt work
java -cp pfcview.jar PfcViewer works in cp only [ October 12, 2004: Message edited by: Art Neil ]
You can make the JAR file itself runnable by following a few steps:
First, create a text file called "manifest.txt". Actually the file name doesn't matter, but this is the name I will use in the rest of the instructions. Add a single line to this file:
(Replace "MyClass" with the actual class name, of course.)
Then create the JAR file:
Again, you should replace "myjar.jar" with the actual name you want and *.java with the actual files to include in the jar.
Once that is done, you can navigate Windows Explorer to the folder that contains the jar and double click on it to run it. You probably create a shortcut by right clicking and selecting "Create Shortcut", but I haven't tried this before.
If you type jar xvf pfcview.jar on the cp you will receive a listing of the contents of the .jar file. You should look to see if there is a META-INF directory with a manifest file in it. Alternately you can browse .jar files using winzip. If the manifest isn't present, you will need to extract the .jar file and then recreate it, including a manifest file as per Layne's instructions.
Originally posted by Art Neil: That completely lost me, Im not a coder. Im just trying to use a little java app that has no shortcut and wont run when I dbl click it.
I'm sorry. I should have clarified if you were packaging the JAR file yourself. Apparently you are using a program written by someone else that is packaged in a JAR, correct? In that case, Stefan's suggestion above should do that trick.
p.s. Does "cp" mean "command prompt"?
Joined: Sep 17, 2004
Heys guys, superior help! Thanks! I did get it working by creating a batch file, worked great. This java stuff is very interesting! Since Ive got the attention of some knowledable guys, let me ask a quick question...
I am interested in Java programming, but from Ive found its incredibly hard to get into a Java training program with no programming experience and even harder to get a Java Coder job with no experience, is this real world fact?
Joined: Dec 06, 2001
I don't know what kind of training program you are referring to, but as for the job, I'm certain that most employers want experience. Many Java Ranchers are learning Java on their own by reading online tutorials and printed books as well as asking questions here. My personal experience with Java started with a semester introduction to the basic syntax and libraries available. I had previous programming experience with other languages, so it wasn't too difficult for me to pick up. For someone without any programming experience, I suspect it will take closer to 6 months or a year to feel comfortable with Java.
If you are interested in learning Java, my suggestion is to find some online tutorials and buy a book. (Suggestions for books have been posted in other threads on many occassions. You can use the Search tool to find these suggestions by clicking the linke towards the top of the page.) Also feel free to post specific questions when you need clarification.