473,406 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

jar file problem

ok im having a go at creating a jar file. i am using cmd to do it. In the
folder that all my class and stuff is in i used the command "jar cf Jrum.jar
DrumMachine.class play.gif stop.gif hithat.wav snare.wav base.wav
cymbal.wav". It appears to have been successful, it made a jar file, but
when i click on it i get this message, "Java Virtual Machine Launcher,
Failed to load Main-Class manifest attribute from c:\java progs/Jrum.jar"
What does this mean? Have i don't this right? How can i over come this?
I am using "Sams teach yourself java 2" and "java 2 in easy steps" but they
are not helping.
thanks
matt
Jul 17 '05 #1
2 18366
well you're main application class is inside the jar file, and it
doesn't know where to locate it. so what you will need to do is set
some "attributes" insdie the manifest file that directs it to the
right place.

Main-Class does that. also you will need to put in a CLASS-PATH
attribute if you are referencing anything outside of the standard jdk
library.

example

Manifest-Version: 1.0
Created-By: 1.4.0_03 (Sun Microsystems Inc.)
Main-Class: yyy.zzz.sss.App
CLASS-PATH: ./activation.jar ./mail.jar

the ./ is from the root of where you are running your jar file. (so
these are in the same directory)

hope this helps,

chris
"webster" <tr********@hotmail.com> wrote in message news:<GE*******************@news-server.bigpond.net.au>...
ok im having a go at creating a jar file. i am using cmd to do it. In the
folder that all my class and stuff is in i used the command "jar cf Jrum.jar
DrumMachine.class play.gif stop.gif hithat.wav snare.wav base.wav
cymbal.wav". It appears to have been successful, it made a jar file, but
when i click on it i get this message, "Java Virtual Machine Launcher,
Failed to load Main-Class manifest attribute from c:\java progs/Jrum.jar"
What does this mean? Have i don't this right? How can i over come this?
I am using "Sams teach yourself java 2" and "java 2 in easy steps" but they
are not helping.
thanks
matt

Jul 17 '05 #2
Here is the command I use (you need to add your other files like *.wav)

jar cvfm NewDraw3.jar META-INF/MANIFEST.MF *.class

The manifest file Chris mentioned goes in a file with
name MANIFEST.MF which is in a directory with name META-INF

The file name on the Main-Class: line tells which file
contains the "main" routine, so for me I have

Main-Class: NewDraw3

Phil...

"Chris" <cb********@liquiddatainc.com> wrote in message news:89**************************@posting.google.c om...
well you're main application class is inside the jar file, and it
doesn't know where to locate it. so what you will need to do is set
some "attributes" insdie the manifest file that directs it to the
right place.

Main-Class does that. also you will need to put in a CLASS-PATH
attribute if you are referencing anything outside of the standard jdk
library.

example

Manifest-Version: 1.0
Created-By: 1.4.0_03 (Sun Microsystems Inc.)
Main-Class: yyy.zzz.sss.App
CLASS-PATH: ./activation.jar ./mail.jar

the ./ is from the root of where you are running your jar file. (so
these are in the same directory)

hope this helps,

chris


"webster" <tr********@hotmail.com> wrote in message news:<GE*******************@news-server.bigpond.net.au>...
ok im having a go at creating a jar file. i am using cmd to do it. In the
folder that all my class and stuff is in i used the command "jar cf Jrum.jar
DrumMachine.class play.gif stop.gif hithat.wav snare.wav base.wav
cymbal.wav". It appears to have been successful, it made a jar file, but
when i click on it i get this message, "Java Virtual Machine Launcher,
Failed to load Main-Class manifest attribute from c:\java progs/Jrum.jar"
What does this mean? Have i don't this right? How can i over come this?
I am using "Sams teach yourself java 2" and "java 2 in easy steps" but they
are not helping.
thanks
matt

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Sean Ross | last post by:
Hi. Recently I made a small script to do some file transferring (among other things). I wanted to monitor the progress of the file transfer, so I needed to know the size of the files I was...
9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
7
by: Keith Dewell | last post by:
Greetings! My current job has brought me back to working in C++ which I haven't used since school days. The solution to my problem may be trivial but I have struggled with it for the last two...
11
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own...
4
by: SS | last post by:
We built an MSI file to deploy a .net app to the workstation. We created an HTML page that has a link to the MSI file. On a very sporadic basis, when the MSI is run we get the following message:...
5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
17
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: ...
4
by: pradqdo | last post by:
Hi folks, I have a very strange problem when I try to port my client/server program to cygwin. It is a simple shell program where the server executes client's commands + it can send and receive...
4
by: Salad | last post by:
I have a situation where some, not all, users get the message "Couldn't find file "F:\AccessApps\AppName.mdw". This file is required for startup". My app the users are attempting to access is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.