Help with JAR creation please

I've created a JAVA program with the Forte IDE and now I want to make it executable without the IDE. I read on this forum that all I had to do was create a JAR file, so I tried but I get an error (see below). Could someone point out my error please.
Also, I tried to run the jar command by itself, I received a command not found error. Only when I preceeded the jar command by JAVA (i.e. JAVA -jar ....) did DOS attempt to run the command.
Second request: Am I missing the path to the jar command in my path variable?
Directory Tree:
vio082\vio\app\
DOS command to create executable JAR:
"java -jar cmf trackerManifest.txt trackerTest.jar trackerTest.Class"
ERROR I RECEIVED:
"Exception in thread "main" java.util.zip.ZipException: The system cannot find the file specified
at java.util.zip.ZipFile.open<Native Method>
at java.util.zip.ZipFile.<init><Unknown Source>
at java.util.zip.ZipFile.<init><Unknown Source>
at java.util.zip.ZipFile.<init><Unknown Source>"
This was my file trackerManifest.txt:
Main Class: trackerTest
[cr]
This is the begining of my file trackerTest.Class:
package vio.app;
import javax.comm.*;
import vio.tracker.*;
import java.net.*;
import java.io.*;
public class trackerTest {
public static void main (String argv[]) {

Hi there,
I'd like to get in on this as well ... I've got a problem of my own with this. In the past I've created packages and ran them alright. And I create my own .jar files all the time on MS Win OS's, which I distribute for others and create desktop shortcuts for, etc. ... no problems; I sometimes jar up applications in unix, even though pretty much everything I run there is command line, just to keep things together.
But I've never jar'd up an application with my OWN packages inside, rather than just the default directory path (IOW: with package statements) and now that I'm trying it's not working quite right ... here's the deal:
Here's the path to the 1st package level: C:\MyMoveSubDir\Mysendrecv\Billsdir\TestPgms
Here's the next dir level:
mytestdir
So, in C:\MyMoveSubDir\Mysendrecv\Billsdir\TestPgms\mytestdir is:
TestClassy.class
and
TestClassy$P1.class
... created from:
TestClassy.java ... the source is:
package mytestdir;
public class TestClassy {
public static final void doNothing() {
System.out.println("What a doNothing method");
protected class P1 {
void afancymethod() {
System.out.println("What a fancy method");
public static void main(String[] argv) {
TestClassy tc = new TestClassy();
tc.doNothing();
P1 p1 = tc.new P1();
p1.afancymethod();
... The manifest file is called mymanifest.txt, and is in:
C:\MyMoveSubDir\Mysendrecv\Billsdir\TestPgms, and looks like this:
Main-Class: mytestdir.TestClassy
I compile the pgm from C:\MyMoveSubDir\Mysendrecv\Billsdir\TestPgms like this:
javac -classpath . mytestdir\TestClassy.java
I run the pgm from same like this:
java -classpath . mytestdir/TestClassy
... and it prints:
What a doNothing method
What a fancy method
...fine.
I can jar it up like this:
C:\MYMOVE~1\MYSEND~1\Billsdir\TestPgms>jar cvfm TestClassyJar.jar mymanifest.txt -C mytestdir/ .
added manifest
adding: mytestdir/./(in = 0) (out= 0)(stored 0%)
adding: mytestdir/./TestClassy$P1.class(in = 594) (out= 374)(deflated 37%)
adding: mytestdir/./TestClassy.class(in = 681) (out= 436)(deflated 35%)
adding: mytestdir/./TestClassy.java(in = 423) (out= 214)(deflated 49%)
But no matter how I try to execute it - like this - it fails with:
C:\MYMOVE~1\MYSEND~1\Billsdir\TestPgms>java -jar TestClassyJar.jar
Exception in thread "main" java.lang.NoClassDefFoundError: mytestdir/TestClassy
... any suggestions anyone. I'd sure appreciate it.
~Bill

Similar Messages

  • Need a little help with JAR creation

    I've created a JAVA program with the Forte IDE and now I want to make it executable without the IDE. I read on this forum that all I had to do was create a JAR file, so I tried but I get an error (see below). Could someone point out my error please.
    Directory Tree:
    vio082\vio\app\
    DOS command to create executable JAR:
    "java -jar cmf trackerManifest.txt trackerTest.jar trackerTest.Class"
    ERROR I RECEIVED:
    "Exception in thread "main" java.util.zip.ZipException: The system cannot find the file specified
         at java.util.zip.ZipFile.open<Native Method>
         at java.util.zip.ZipFile.<init><Unknown Source>
         at java.util.zip.ZipFile.<init><Unknown Source>
         at java.util.zip.ZipFile.<init><Unknown Source>"
    This was my file trackerManifest.txt:
    Main Class: trackerTest
    [cr]
    This is the begining of my file trackerTest.Class:
    package vio.app;
    import javax.comm.*;
    import vio.tracker.*;
    import java.net.*;
    import java.io.*;
    public class trackerTest {
         public static void main (String argv[]) {

    Thanks for the help so far. My first problem was that the directory with the "jar" command was not in my path (now that fixed). My application still won't execute and I think it has to do with the following:
    My application uses the serial port to communicate with a device and uses a socket server to communicate with a C++ program. The following JAVA utilities are imported to make my application work:
    javax.comm.
    java.net.
    ijava.io.
    If I use the command:
    "jar cvfm trackerTest.jar trackerManifest.txt trackerTest.Class"
    will the appropriate files from javax.comm, java.net and ijava.io also be incorporated into the jar file? If not, how are they made available when I distribute my jar to other users?
    Second question:
    Should I be using:
    "jar cvfm trackerTest.jar trackerManifest.txt vio082/*.*"
    to capture all the other classes required by my package that are in other directories above and below the trackerTest.class directory?
    Any help is greatly appreciated.
    JAM

  • Help with access control please

    So I'm trying to set up my brother's PSP to the wirless network through MAC address timed access. What I want to do is make it so that he can only access it through certain times in the day. I'm having troubles with actually getting it to work. Everytime I set it up, the PSP only show's up as a DHCP client and not a Wireless client. I tried the option panel with the add wireless clients through the first try access. Could I get some help with this issue please? Thanks!

    Just to calm your fears... There is no conspiracy. If someone had an answer or a suggestion they would post it.

  • I am new with JAR files please help me

    Hi Dear All,
    I am new with JAR files, I know concept, but dont know how to careate JAR, and how do i use it?
    Please help me.
    Thanks

    This tutorial covers that:
    http://java.sun.com/docs/books/tutorial/deployment/jar/index.html

  • Please Help With Jar File

    I have a jar file named Helper.jar with
    com.xyz.util.Helper.class in it.
    Now I have a SrcFile.java that
    imports com.xyz.util.Helper;
    It compiles fine with:
    java -classpath Helper.jar;. SrcFile.java
    ...and runs fine with:
    java -cp Helper.jar;. SrcFile
    When I jar it with:
    jar cvfm SrcFile.jar SrcFile.mf *.class
    ...and run it with:
    java -cp Helper.jar;. -jar SrcFile.jar
    I get the following exception:
    java.lang.NoClassDefFoundError: com/xyz/util/Helper
    ...but yet, Helpler.jar runs fine with:
    java -jar Helper.jar
    Does anyone have any idea what I am doing wrong or
    do I have to un-jar the Helper.jar file and
    re-jar SrcFile.jar with all the .class files?

    I've replied to this same thread in the New To Java Technology fourm, see there for a suggestion.

  • Help with photo albums Please

    Hi, i really need some help with my pictures, I've only got a very basic understanding of how my phone works and have somehow put a load of albums on my phone when i plugged it into the computer-I want to delete some of them off the phone but cannot work out how to do it, when i plug my phone in i can find the photo tab but cannot actually see the pictures and can't see any delete button!!! Please can someone help me, basic explanations would be gratefully recieved xxxx

    The photo sync is one way: computer to phone. To remove photos, synced to your phone, remove the check marks next to the albums/folders under the photos tab in itunes & hit the apply/sync button. They will be removed from your phone. You cannot delete photos that were synced to your phone, directly on your phone. The easiest way to manage photos synced to your phone is to create albums or folders on your computer. Move whatever photos you want on your phone into these albums/folders & then select them under the photos tab in itunes to sync to your phone. You can then remove or add photos to these various albums/folders on your computer & the itunes sync process will update your phone every time you sync.

  • Help with Validation Problem Please

    I don't understand this validation and don't know how to fix it. I have checked my other websites and they seem fine. I don't think I have done anything different The link for the website ishttp://www.greenpatchwebsites.com/pow/index.html
    and the validator is http://validator.w3.org/check?uri=www.greenpatchwebsites.com%2Fpow%2Findex.html&charset=%2 8detect+automatically%29&doctype=Inline&group=0
    Please can you help.
    Thank you very much in advance.

    Thanks for that. I have tried it on a new page: http://www.greenpatchwebsites.com/pow/newtest.html and here is the validator :
    http://validator.w3.org/check?uri=www.greenpatchwebsites.com%2Fpow%2Fnewtest.html&charset= %28detect+automatically%29&doctype=Inline&group=0&No200=1- unfortunately loads of errors
    I also tried the recommended template:
    Use the following markup as a template to create a new XHTML 1.0 document using a proper DOCTYPE. See the list below if you wish to use another document type.
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
         <title>An XHTML 1.0 Strict standard template</title>
         <meta http-equiv="content-type"
              content="text/html;charset=utf-8" />
         <meta http-equiv="Content-Style-Type" content="text/css" />
    </head>
    <body>
         <p>… Your HTML content here …</p>
    </body>
    </html>
    but was getting errors with that. As you can tell, I need serious help with this. Which doc type should I be using
    and why doesn't Dreamweaver just do it for you when you select one?
    Thanks very much again in advance.

  • Help with Option 3 please

    A week ago I was on Option 1 but due to heavy use my speed was reduced to 15.7k/sec !.I was advised to upgrade to Option 3 which I promptly did and that was done on the 29th(last week).
    My speed though is still 15k/sec and I cannot watch any streaming video or BBC News Channels etc
    Would some kind gentleman please look into it for me and advise.......thankyou
    Solved!
    Go to Solution.

    Hi Pete,
    I am sorry for the delay in getting back to you.  I picked your email up this morning and have dropped you a reply.  I am pleased that you managed to sort this out, if you need any further help just let me know.
    Cheers
    Sean
    BTCare Community Manager
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • Help with button code please?

    I am a novice and have just completed my first animated movie. I need help with action script.
    The movie is currently looped and I have created and invisible button the size of the frame with the intention that a user can click on the movie image to stop it and on second click continue the movie from where it stopped.
    I have used the AS event handler method to stop the movie. I have tested it and it works. But I cannot figure suitable code to restart the movie.
    Two questions;
    1. am I going about the task the right way? (should I use two buttons, one stop, one start)?
    2. if my approach is feasible, can anyone give me the correct AS to re-start the movie and put me out of my misery please?

    you can use the following after changing "yourbutton" and "yourmovieclip" to use suitable instance names:
    yourbutton.onRelease=function(){
    if(!this.toggle){
    yourmovieclip.stop();
    } else {
    yourmovieclip.play();
    this.toggle=!this.toggle;

  • Help with Required fields-PLEASE

    I have been attempting to get help with a required field and one of the forum helpers said he got it to work for me but I cannot and I have not been able to get any more responses from him to help me further.
    I am attempting to have a radio box when the YES is selected to require another field to be completed.  The script I was provided with is:
    getField("Location").required = (getField("Group1").value == "Yes");
    Location being the field that I require to be filled in if Group 1 is Yes.  The previous forum helper indicated that I had to have this script in both fields in Group 1 and when I do that, nothing different happens. 
    What am I doing wrong? 
    Please, I need to fix this right away and I will be using this java script on many other forms that I have so I need to get this done soon.
    Thank you in advance.

    Wht you want can get somewhat complicated. One way to prevent subsequent fields from being used is to set them to read-only and/or hidden. You could then use the Validate event of the text field to validate the entry and enable the subsequent fields if it is filled-in adequately. In general, you should also reset the fields whenever you hide them, so they don't contain potentially invalid data from previously being filled-in. So you could initially have the fields set to be hidden, and only unhide them if No is selected, or if Yes is selected and the required text field is filled-in.
    I realize this may not be as helpful as you had hoped for, but I can't suggest specific code without knowing more about the form.

  • Help with a routine please

    Hi experts!
    I have a requirement and I need help with an abap routine.
    I'm uploading a table from de ECC where each record contains one key figure per fiscal period (wlt01, wlt02,...wlt16). I need to have in a dso a unique key figure (called zwlt for instance) and the 0fiscper infoobject filled with the corresponding period, that is, for each record of the table, I need 16 records in the DSO with zwlt = wltXX and the fiscper = fiscyear&0&XX.
    Any help please?
    Thanks in advance.

    there are multiple ways to handle this.
    one way is to use APD to unpivot the data.
    or else you can use the following sample code to derive what you want...this code might just hint at the way to proceed.
    TYPES:
      BEGIN OF tys_SC_1,
          wlt01           TYPE P LENGTH 8 DECIMALS 2,
          wlt02           TYPE P LENGTH 8 DECIMALS 2,
          wlt03           TYPE P LENGTH 8 DECIMALS 2,
          wlt04           TYPE P LENGTH 8 DECIMALS 2,
          wlt05           TYPE P LENGTH 8 DECIMALS 2,
          wlt06           TYPE P LENGTH 8 DECIMALS 2,
          wlt07           TYPE P LENGTH 8 DECIMALS 2,
          wlt08           TYPE P LENGTH 8 DECIMALS 2,
          wlt09           TYPE P LENGTH 8 DECIMALS 2,
          wlt10           TYPE P LENGTH 8 DECIMALS 2,
          wlt11           TYPE P LENGTH 8 DECIMALS 2,
          wlt12           TYPE P LENGTH 8 DECIMALS 2,
      END OF tys_SC_1.
    DATA: ls_type TYPE tys_SC_1,
          l_name TYPE string,
          l_count Type n length 2.
    FIELD-SYMBOLS:
                <fs_type> TYPE tys_SC_1,
                <result>  TYPE P .
    ls_type-wlt01 = '1.1'.
    ls_type-wlt02 = '2.2'.
    ls_type-wlt03 = '3.3'.
    ls_type-wlt04 = '4.4'.
    ls_type-wlt05 = '5.5'.
    ls_type-wlt06 = '6.6'.
    ls_type-wlt07 = '7.7'.
    ls_type-wlt08 = '8.8'.
    ls_type-wlt09 = '9.9'.
    ls_type-wlt10 = '10.1'.
    ls_type-wlt11 = '11.11'.
    ls_type-wlt12 = '12.12'.
    CLEAR:  l_count ,  l_name.
    l_count = '01'.
    ASSIGN ls_type TO <fs_type> .
    Write: / .
    DO 12 TIMES.
      clear: l_name.
      Concatenate 'wlt'  l_count into l_name.
      ASSIGN COMPONENT l_name  OF STRUCTURE  <fs_type> TO <result> .
      Write: / , l_name , ' = ' , <result>.
      l_count = l_count + 1 .
    ENDDO.
    hope it helps.
    Regards
    Ashwin

  • Help with UILabel subclass please

    Hello all... I have a UILabel subclass I call CustomLabel. Ive been googling and reading the apple docs this entire week to figure this out. The few examples Ive seen, I dont think Im doing it right.
    Im trying to create a subclass to use throughout my project. Every label will have these properties so I figured why not subclass. So through a lot of trial and error I ended up with this...
    CustomLabel.h
    #import <UIKit/UIKit.h>
    @interface CustomLabel : UILabel {
    @property (nonatomic) CGSize shadowOffset;
    @property (nonatomic) UITextAlignment *textAlignment;
    @property (nonatomic, retain) UIColor *shadowColor;
    @property (nonatomic, retain) UIColor *textColor;
    @property (nonatomic, retain) UIColor *backgroundColor;
    @property (nonatomic, retain) UIFont *font;
    @end
    CustomLabel.m
    #import "CustomLabel.h"
    #import "Constants.h"
    @implementation CustomLabel
    @synthesize textColor;
    @synthesize backgroundColor;
    @synthesize font;
    @synthesize shadowColor;
    @synthesize shadowOffset;
    - (id)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
    self.textColor = [UIColor whiteColor];
    self.backgroundColor = [UIColor clearColor];
    self.font = SMALL_CHALKDUSTER;
    self.shadowColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.35f];
    self.shadowOffset = CGSizeMake (0, 2);
    self.textAlignment = UITextAlignmentCenter;
    return self;
    - (void)dealloc {
    [super dealloc];
    @end
    I then allocate a label like so...
    ViewController.h
    CustomLabel *myLabel;
    @property (nonatomic, retain) CustomLabel *myLabel;
    ViewController.m
    myLabel = [[CustomLabel alloc] init];
    myLabel.text = @"Blah blah blah";
    I feel like Im way off on this... I must be since it isnt setting any of the properties Im trying to use in the subclass.
    I found an older post on the forums here for setting the textAlignment but for some reason I couldnt apply the same logic to mine.
    So can anyone help me with this subclass please and thank you?

    xnav... thanks a ton for pointing me to this link. Its got me closer to my end goal than I was before. Right now I have...
    CustomLabel.h
    #import <UIKit/UIKit.h>
    @interface CustomLabel : UILabel {
    @end
    CustomLabel.m
    #import "CustomLabel.h"
    #import "Constants.h"
    @implementation CustomLabel
    - (void) drawRect:(CGRect)rect {
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    UIColor *lineColor = [UIColor whiteColor];
    UIColor *shColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.35f];
    //UIColor *bkgColor = [UIColor clearColor];
    CGContextSetFillColorWithColor(ctx, lineColor.CGColor);
    CGContextSetShadowWithColor(ctx, CGSizeMake(0, 2), self.font.pointSize / 2.0, shColor.CGColor);
    //CGRect drawRect = CGRectMake(rect.origin.x, rect.origin.y,rect.size.width, rect.size.height);
    //CGContextSetAlpha(ctx, 0) ;
    //CGContextFillRect(ctx, drawRect);
    //CGContextSetStrokeColorWithColor(ctx, [[UIColor clearColor] CGColor]);
    //CGContextSetFillColorWithColor(ctx, [[UIColor clearColor] CGColor]);
    CGContextSetBlendMode(ctx, kCGBlendModeClear);
    //CGContextAddEllipseInRect(ctx,CGRectMake(size.width-(size.width/2)-(size.width/10), (size.width/10), (size.width/2), (size.height/2)));
    //CGContextClosePath(ctx);
    //CGContextDrawPath(ctx, kCGPathFillStroke);
    //CGContextSetTextDrawingMode(ctx, kCGTextFillStroke);
    //self.backgroundColor = [UIColor clearColor];
    //[self setBackgroundColor:[UIColor clearColor]];
    [self.text drawInRect:self.bounds withFont:TINY_CHALKDUSTER lineBreakMode:self.lineBreakMode alignment:UITextAlignmentCenter];
    - (void)dealloc {
    [super dealloc];
    @end
    As you can see I have a couple of things commented out. LOL I still cant figure out how to make the background color clear. I also dont know if I need the dealloc in this subclass. But the other properties seem to be working like the font and line color.
    Thanks again for the link and getting me in the right direction xnav. If you can lend any more assistance on how to get that darn background color clear I would appreciate it!

  • Help with Wireless thingy Please!!!

    Hi, could someone please help with this? I am quite computer literate except when it comes to anything wireless or networking as it is something I've never used, so heres the problem - I bought ATV, and put a wireless card in the computer - do i need a seperate router to create a network? ATV searches for a network, and finds one, but I am not sure its mine!! ATV not coming up in itunes. Ive tried everything, but its just not happening. If I need a router, fine I'll get one, but if not could I have some instructions please?!!!! Like what on earth do I put in if adding network to atv manually? How do I know what my network name is? Tried with firewalls disabled, and added ports 3689 and 5353 to exceptions. Bearing in mind I need translations for things like DHCP etc! Its a Belkin Wireless G+ Network Card, compatible with ATV. Please help as this is the only thing standing between me and music heaven!!thankyou!

    On a mac you could create an ad hoc network with a mac with wi-fi card only and internet sharing enabled, I've not done it and I don't know whether one has the choice to name the network or whether it will be identified as the mac's network name. I guess you will need advice from a PC guy as to whether this can be done on a PC, but my guess is that it can.

  • Help with mail installatioin please

    could somebody please help with the installation of mail...I have had my mac for 7 months now, and can't use the mail application.
    Somebody help please before I die?
    thanks
    n9mila

    i don't understand...the whole outgoing thing!
    my email address is in hotmail. k! I don't have a .mac account
    explain this
    "incoming Mail Server: The server where your mail waits for you to retrieve it. Also called a POP or IMAP server. Enter the address (name) of the mail server where your mail account resides, and where mail is stored. For example, mail.example.com."
    and this
    "Outgoing Mail Server: The server that sends your mail to its destination. Also known as an SMTP server. For example, smtp.example.com. To see the server in use by each mail account, choose Edit Server List from the Outgoing Mail Server pop-up menu."
    sorry, I'm very slow to comprehending

  • I would need help with the following please: I need to save some of my email on a disk. I was going to Print, then Save PDF but then I am stuck. Help please. Thanks. Elisabeth

    I would need help with saving some eamil messages to a disk to unclutter my email. How can I do this please?
    Thanks.
    Elisabeth

    Open the email and then from the File menu select Save As Rich Text Format. That'll save it to open in TextEdit. If you want a pdf then open the email and do command-p (Print) and then from the PDF drop down box lower left corner select Save as PDF.

Maybe you are looking for