473,749 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.cla ss 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 18375
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********@hot mail.com> wrote in message news:<GE******* ************@ne ws-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.cla ss 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********@liq uiddatainc.com> wrote in message news:89******** *************** ***@posting.goo gle.com...
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********@hot mail.com> wrote in message news:<GE******* ************@ne ws-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.cla ss 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
23172
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 transferring. Finding out how to get this information took some time (reading the manuals - googling did not prove worthwhile). Anyway, I did eventually figure out how to do it (there are a few ways, including os.path.getsize(filename)). My...
9
3204
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 indeed also true for our language of choice, Python. Its file type allows some extraordinary convenient access like: for line in open("blah"): handle_line(line)
7
3779
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 days and would appreciate this group's helpful expertise. My problem may be related to mixing the C and C++ languages together. Namely, I have a struct which I cannot change (as legacy code) similiar to this (I will change the names throughout as...
11
3647
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 rules when it comes to file paths. A lot of Microsoft installers for example, and also installers of other companies, do not work because they handle paths in the following manner:
4
11881
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: The cabinet file '_blahblahblah' required for this installation is corrupt and cannot be used. This could indicate a newtwork error, an error reading from the CD-ROM, or a problem with this package. The MSI file fails consistently on some...
5
11053
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 created in the wrong folder on the hard drive. Before I discovered these files, .NET kept trying to create a new project with _1 following the project name. Deleting those files corrected that problem. I deleted the Virtual Directory, rebooted, and...
8
9759
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 problem: my vb.net program has problems with UNC. If the UNC server is restarted or goes off-line, my VB.net program crashes. The code for UNC access to the file is included below and is put in the tick event of a form timer control running every...
17
8029
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: I am trying to use the SaveFileDialog class to get a filename, which is subsequently opened for writing (write access, read sharing, but using read/write sharing doesn't make the problem go away anyway). Sometimes, on the statement where I...
4
5708
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 files (something like ftp server/client). I implemented all the commands which the server executes from scratch meaning I don't use fork and exec. It was very educational but my problem is that when I try to "get <filename>" from server to the...
4
4065
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 written A2003 and they use the A2003 runtime to access the application. They use a desktop icon that specifies the location of Access, the Appname, and the MDW file to use. Ex: "C:\ProgramFiles\Office\MSACCESS.EXE" "C:\Apps\App.MDB" /wrkgrp...
0
8833
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6801
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.