×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    76

    Question Problem while creating .jar file

    Hi friends,

    I'm try to run the application using command prompt .For that before building such application i set all the environment variables which they specify.While creating .jar from manifest.txt file , i've use follwing command ,

    jar -cfvm E:j2me\midlets\HelloWorld.jar manifest.txt -c

    E:\j2me\classes\greeting

    But it is throwing follwing Exception.
    "E:j2me\midlets\HelloWorld.jar (The system cannot find the path specified)
    at java.io.FileOutputStream.open(Native Mthod)
    at java.io.FileOutputStream.<init>(FileOutputStream.jave:179)
    java.io.FileOutputStream.<init>(FileOutputStream.jave:70)

    at sun.tools.jar.Main.run(Main.java:133)
    at sun.tools.jar.Main.main(Main.java:904)"


    The contains of manifest.txt

    MIDlet-Name: Hello World
    MIDlet-Version: 1.0
    MIDlet-Vendor:
    MIDlet-1: HelloWorld, /greeting/logo.png ,greeting.HelloWorld
    MicroEdition-Configuration: CLDC-1.0
    MicroEdition-Profile: MIDP-1.0



    How could i resolved this problem?


    Regards,
    Sachin Warang.

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    13

    Re: Problem while creating .jar file

    Quote Originally Posted by sachinwarang
    Hi friends,

    I'm try to run the application using command prompt .For that before building such application i set all the environment variables which they specify.While creating .jar from manifest.txt file , i've use follwing command ,

    jar -cfvm E:j2me\midlets\HelloWorld.jar manifest.txt -c

    E:\j2me\classes\greeting

    But it is throwing follwing Exception.
    "E:j2me\midlets\HelloWorld.jar (The system cannot find the path specified)
    at java.io.FileOutputStream.open(Native Mthod)
    at java.io.FileOutputStream.<init>(FileOutputStream.jave:179)
    java.io.FileOutputStream.<init>(FileOutputStream.jave:70)
    Try to write jar -cfvm E:\j2me\midlets\HelloWorld.jar manifest.txt -c instead of jar -cfvm E:j2me\midlets\HelloWorld.jar manifest.txt -c. Notice the added \. E:\... instead of E:...

  3. #3
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    76

    Question Re: Problem while creating .jar file

    Hi friend,
    This work fine when i put '\' after E:.It also creates the jar file.And u also have give the path after -c which specifies where exactly class file lies.

    The command is,

    jar -cfvm E:\j2me\midlets\HelloWorld.jar manifest.txt -c E:\j2me\classes\greeting


    It is creating .jar file in midlets folder.
    By extracting it i get 2 folders,
    1)midlets\HelloWorld\j2me\classes\greeting
    which contains class file and .png image

    2)\midlets\HelloWorld\META-INF
    which contains the manifest file

    But while excuting the above command it gives follwing error


    E:\j2me\src\greeting>jar -cfvm E:\j2me\midlets\HelloWorld.jar manifest.txt -c E:\j2me\classes\greeting
    -c : no such file or directory
    added manifest
    adding: E:/j2me/classes/greeting/(in = 0) (out= 0)(stored 0%)
    adding: E:/j2me/classes/greeting/HelloWorld.class(in = 1554) (out= 710)(deflated 54%)
    adding: E:/j2me/classes/greeting/logo.png(in = 295) (out= 295)(deflated 0%)

    E:\j2me\src\greeting>

    Note:
    contains of manifest.txt

    MIDlet-Name: Hello World
    MIDlet-Version: 1.0
    MIDlet-Vendor:
    MIDlet-1: HelloWorld,/greeting/logo.png,greeting.HelloWorld
    MicroEdition-Configuration: CLDC-1.0
    MicroEdition-Profile: MIDP-1.0



    Does anyone know Whats the coz for this error?
    which file it doesn't get while jaring as you see that
    it first added the manifest file
    then while adding it shows (in = 0) (out= 0)(stored 0%) what is exactly it is looking for?
    then added class file
    and in the last the .png file

    How could i resolved this problem?
    What i've include/remove while creating .jar file?

    When i run the midlet using follwing command

    midp -classpath HelloWorld.jar -Xdescriptor HelloWorld.jad
    It throwing class not found exception.

    This is might be coz in .jar file the class file is stored in
    midlets\HelloWorld\j2me\classes\greeting
    which should stored in
    midlets\HelloWorld\greeting

    When i change the command for creating .jar it is not added the class file and image which stored in E:\j2me\classes\greeting dir.

    Note:
    contains of .jad file

    MIDlet-Name: Hello World
    MIDlet-Version: 1.0
    MIDlet-Vendor:
    MIDlet-Description: My First MIDlet suite
    MIDlet-1: HelloWorld, /greeting/logo.png ,greeting.HelloWorld
    MIDlet-Jar-URL: HellowWorld.jar
    MIDlet-Jar-Size: 1901

    How could i resolved both this issues?


    Regards,
    Sachin Warang.

Similar Threads

  1. Problem with reading a file........
    By rafeeqpv in forum Symbian C++
    Replies: 0
    Last Post: 2005-11-15, 13:09
  2. File save problem
    By zwgoal in forum Symbian C++
    Replies: 3
    Last Post: 2005-11-11, 10:11
  3. .jar and .sis unrecogonised file format on N6230
    By vinaydeep in forum Mobile Java General
    Replies: 2
    Last Post: 2005-04-20, 12:58
  4. JAD file problem with 3100/6100
    By rkanhere in forum Mobile Java General
    Replies: 3
    Last Post: 2004-06-24, 19:07
  5. JAD file problem with 3100/6100
    By rkanhere in forum Mobile Java General
    Replies: 0
    Last Post: 2004-06-21, 14:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •