Jar command problem

Hi
I am trying to create a jar for my java project. I am using NetBeans so at first i thought that i could have NetBeans create it for me. But the help function just tells me that it is generated automatically in a folder called "dist". The problem is that the dist-folder does not contain any jar-file.
Then i though i could create it from the command line using the
jar cf MyJar.jar MyClass.classcommand. But when i try this i get a message saying "'jar' is not recognized as an internal or external command". I tried to re-install my JDK but no luck. My guess is that both the netbeans problem and the command line problem are because of the same reason.
Anyone know how i could solve this? All answers are appreciated.
Thank you
//Patrik

update your PATH variable.
see 4. Update the PATH variable (Optional) here http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html

Similar Messages

  • Jar command

    Dear All ,
    I have problem to extract web archieve file ....named jsppro.war .
    How do i extract these file and what is the command ???Do jar command able to extract these file.
    TQ.

    How do i extract these file ....what is the command pls.

  • Jar command jar -uf doesn't work on Vista

    I try to use the jar command jar -uf to add information from a JAR into another. This works fine on XP, but not on Vista.
    I use the same commands and the same files on Vista and XP, but I get this error message on Vista:
    java.io.IOExeption: An error occured when writing to the JAR file
    Why does this happen? How can I make the jar command jar -uf work on Vista?

    I don't use Vista however it could be related to a [Vista file permission problem|http://paulstamatiou.com/2007/02/09/how-to-quickie-vista-permissions].

  • Executing jar command from the java application

    Hi All,
    In my application i want to create a jar file with the existing class @ Runtime and want to download . But i tried to execute the jar command via Process.getRuntime, it throws IOException. Please guide me or give the solution

    PavithraKarthikeyan wrote:
    Please guide me or give the solutionQuestion your need for this. Why do you think you need to create the jar file.
    P.S. The jar command is only available if the user has the JDK installed so if he has only the JRE installed then you have a problem using Runtime.exec(). There are classes (java.util.jar.JarFile et al) that will allow you to jar files using Java code.

  • How to schedule jar command on linux in /etc/crontab

    hello ,
    i am facing a problem in scheduling java -jar myjarfilename.jar in crontab in linux .i have tried by giving the command directly in the /etc/crontab entry and running it as a script from the crontab but in vain.please give me some ideas how to schedule this jar command on linux in /etc/crontab.
    thanx

    Stuff the above accept for the STARs read about them;
    This a REAL BASIC senerio. ASSUMING you are paulb the user
    To add a cron job it is BEST to use "crontab"
    1) MAKE SURE YOU CAN USE CRONTAB
    check "/etc/cron.d/cron.deny " does not exist and it does not have your username in it
    If it does, you will have to remove your name somehow or just delete the file.
    2) MAKE YOUR SCRIPT
    using your fav editor like "joe" or "pico" or err "vi" make a textfile called "home/paulb/hiscript.sh"
    This script is just saying hi in sh and then printing a date when it said hi in the dumbhi.log
    --------start of hiscript.sh----------------
    #!/bin/sh
    echo "hi at";date > /home/paulb/dumhi.log;
    --------end of hiscript.sh----------------3) MAKE SCRIPT EXECUTABLE
    run the command
    "chmod +x /home/paulb/hiscript.sh"4) MAKE A CRONTAB FILE FOR YOURSELF
    using your fav editor like "joe" or "pico" or err "vi" make a textfile called "home/paulb/paulb.ct"
    This is EVERY 1 min run that script. See u need to know the commands
    -----start of paulb.ct-------------------------
    1  *  *  *  *   home/paulb/hiscript.sh
    -----end of paulb.ct-------------------------5) ADD THE CRON JOB
    run the command
    "crontab /home/paulb/paulb.ct"All done

  • Unable to use javac or jar commands

    Hi all,
    I've been using my IDE to compile and run my programs. However, when I want to use -javac or -jar commands in my command prompt, it doesnt work.
    The error is :
    'javac' is not recognised as an internal or external command,
    operable program or batch file
    Same goes for jar
    -java works for me. Why is that so? I hope anyone can give me solution.
    Note : I'm on windows vista
    Another question :
    I've been using JMF (Java Media Framework) to develop a simple audio player. However it can be run on my pc. What happens if I try to run the program at another pc, will it still work? The other pc will not have JMF installed, but will have JRE to run java apps. If it cannot be run on the other pc, is there any solution?
    Thank you for your kind assistance.
    Edited by: TrAnScEnD3nT on Sep 30, 2007 10:18 PM
    Reason : Sorry I have mixed up java and javac, I've corrected it.

    Mainta? That's my favourite!This time...
    In very general terms the PATH is a system variable that is maintained and used by your operating system or shell (not Java) to locate executable files. So, for instance, if you type the command:
    >writeit will be the PATH that Windows uses to locate the write.exe word processor.
    The directory containing the Java tools - java.exe, javaw.exe, jar.exe, appletviewer.exe etc - very commonly goes into the PATH variable.
    The classpath is a list of locations that Java uses to locate classes (as you said). It is used by Java and not your operating system. It is commonly (but not always) set each time you use one of the Java tools. There is a -cp switch that lets you do this. For instance a common command to compile a file would be
    >javac -cp . HelloWorld.javaThe "-cp ." bit means "the classpath shall be the current directory".
    Setting a particular classpath does not, in general, affect the "built in" classes of Java, so you don't have to worry about this. If you search the documentation that came with your distribution you will find the exact rules for "how classes are found": but to begin with the important thing is that any classes you write must be included in the classpath which can be specified as part of the commands to compile or run your code.

  • Jar File Problem Using External Packages

    I am having problems creating an Executable jar file that imports classes from my own package.
    I can create an exe jar no problem without using any external packages, but when I use an external package the jar will not execute.
    I am using WindowsXP, my package is in,
    C:/MyClasses/Database
    the class files are stored loose, not in a jar file
    I have tried altering the class-path in the manifest file, but to no joy - I may have not changed the classpath correctly!
    Please help
    Magic

    This is a mine field of "correct programming style."
    External jars, if very general, could be placed in the directory jre/lib/ext.
    In some cases you can unzip the external jars and add them to your own jar.
    The manifest.mf migth be looked into, and of course you need to communicate your patching!
    As you remarked, it might be a problem of class path usage.
    For that the jar tool documentation might explain it better than I.

  • SQL Command problem in Application Express 3.2.0.00.27

    To Oracle Application Express Development Team,
    Yesterday I installed Oracle Application Express 3.2.0.00.27.
    While doing my r&d, I came across one problem in SQL Command.
    For example I wanted to run sql "select * from tab"
    When I checked "Autocommit" checkbox it worked fine.
    But when I unchecked the "Autocommit" checkbox it gave me following error:
    ORA-01003: no statement parsed
    Please check post
    http://www.oraclebrains.com/2009/03/sql-command-problem-in-application-express-3200027/ for more details.
    Cheers

    I can't find the log file (a good indication that something went wrong)
    Here's the transcript of the session...
    SQL> startup upgrade
    ORACLE instance started.
    Total System Global Area 599785472 bytes
    Fixed Size 1288820 bytes
    Variable Size 264242572 bytes
    Database Buffers 331350016 bytes
    Redo Buffers 2904064 bytes
    Database mounted.
    Database opened.
    SQL> @apxpatch.sql
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    Wrote file apxset.sql
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    SQL>
    SQL> @apxldimg.sql
    PL/SQL procedure successfully completed.
    Enter value for 1: C:\Documents and Settings\jtench\Desktop\My Downloads\Oracle\apex_3.2.1
    old 1: create directory APEX_IMAGES as '&1/apex/images'
    new 1: create directory APEX_IMAGES as 'C:\Documents and Settings\jtench\Desktop\My Downloads\Oracle\apex_3.2.1/apex/images'
    Directory created.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    Commit complete.
    timing for: Load Images
    Elapsed: 00:03:30.03
    Directory dropped.
    SQL>

  • Can new folder be added into a war using jar commands?

    Hi All,
    I am working on an installer creation attempt to make some changes on a war at the client side to inject my changes into it. As a result i am in need to modify the war using jar commands and have found some success.
    I user the following command.
    D:\MyWarLab>jar uf webtop.war customThis command helped me in adding my changes inside a folder named 'custom' placed at location 'D:\MyWarLab' into the 'custom' folder inside my 'webtop.war'.
    Now this worked as expected since the 'custom' folder was already present inside the war.
    Now my next step is to inject a new folder named 'customA' inside
    webtop.war ->WEB-INF -> classes -> com -> application. This customA folder would contain the java class files i have created.The customA folder does not already exist at the above mentioned location, hence the need to create it.
    I have not been able to find a jar command to add new folders at desired locations of the war.
    Could you please validate my attempt and suggest a command to fulfil my requirement.

    Now this worked as expected since the 'custom' folder was already present inside the war.No. It worked because 'custom' existed in the file system as a directory with files under it. Whether it was already in the war is irrelevant.
    This customA folder would contain the java class files i have created. The customA folder does not already exist at the above mentioned location, hence the need to create it.If it exists on the disk you can add it to the war with the jar uf command.
    I have not been able to find a jar command to add new folders at desired locations of the war.You've already found it!

  • Cant execute jar command?

    hi, i am a newb in j2ee. my reference is the beginning java ee 5 from apress. the application server that the book is using is JBoss, and while i try to write my first example, i need to make a war and an ear file, so i tried to do it in the console. i went to the directory of my first example and the tried to execute this: >jar cf web-app.war index.jsp but an error occur and said 'jar' is not recognized as an internal or external command,
    operable program or batch file.
    question is, how can i make those files if i cant execute the "jar" command.
    **by the way, i have a successful installation of JBoss.
    thanks in advance.
    sorry, i guess this is the wrong forum.
    Message was edited by:
    pleigher

    The jar command should be installed in your JDK HOME\bin directory, but you could also use winzip.
    Once you've got the hang of things you should forget about building war and jar files from the command line, you're much better using a build tool such as maven2.
    http://maven.apache.org/
    There's quite a bit to it but it has pre-configured templates for war and ejb projects.

  • How to create java archive using jar command

    hello
    what is the syntax for creating java acrchive using jar command line
    jar -c ???????
    urgent plzz

    jar cf myjar.jar classfiles...
    If you have a manifest file you want to add:
    jar cfm myjar.jar manifest.mf classfiles...
    Also check the documentation:
    http://java.sun.com/j2se/1.3/docs/tooldocs/tools.html
    You can find a link to jar there.

  • Jar command throwing error

    Hi,
    I'm trying to extract a war file via the jar command; however, when I issue:
    jar -xvf MyWarFile.war
    I'm recieving :java.io.IOException: META-INF : could not create directory
    at sun.tools.jar.Main.extractFile(Main.java:699)
    at sun.tools.jar.Main.extract(Main.java:677)
    at sun.tools.jar.Main.run(Main.java:189)
    at sun.tools.jar.Main.main(Main.java:903)
    I am giving proper path where the war file is located.
    Can someone tell why jar is not being extracted and this error is coming?
    Thanks

    It happens due to an incorrectly created war file when using the counterpart command jar -cvf. Make sure the war you have created does not have any missing directories or incorrect path.

  • Jacob.jar and Webutil.jar singing problem(URGENT)

    I read the instructions 'Configuring the webutil' and I found that there is not a reference in the file 'signer.properties' which is referenced in the on-line help of Forms Developer (step 4).
    The problem is that when i try to sign the 2 jar files 'frmwebutil , jacob'
    using this command
    E:\oracle\ora92\forms90\WEBUTIL>SIGN_WEBUTIL.BAT e:\oracle\ora92\forms90\java\jacob.jar
    after this command a essage appears:
    Genrating self signing certificate for key=webutil2...
    Keytool error :java .lang.execption:key pair not genrated ,alias <webutil2> already exists
    there were wanings or error while genrating a self singing certifciate . please review them.
    backing up e:\oracle\ora92\forms90\java\jacob.jar as e:\oracle\ora92\forms90\java\jacob.jar.old
    1 file(s) copied..
    singing e:\oracle\ora92\forms90\java\jacob.jar using key=webutil12...
    'jarsigner' is not recognized as an internal or external command.
    Is there a chance that the cause of this problem is that there is not the file 'signer.properties'?
    What can I do ?
    AND WHAT THE NEXT STEP AFTER THIS....
    INDU

    Update the sign_webutil.bat to add the full path before the jarsigner line
    Here is the files I use:
    makecert.bat:
    for /F "eol=# tokens=1,2* delims==" %%i in (signer.properties) do set %%i=%%j
    "%JDK_HOME%\bin\keytool" -genkey -dname "cn=%DN_CN%, ou=%DN_OU%, o=%DN_O%, c=%DN_C%" -alias %JAR_KEY% -keypass %JAR_KEY_PASSWORD% -keystore "%JINIT_HOME%\lib\security\keystore" -storepass jinitiator -validity 360
    @echo Certificate created...
    sign.bat:
    for /F "eol=# tokens=1,2* delims==" %%i in (signer.properties) do set %%i=%%j
    copy /Y %1 %1.unsigned
    @echo on
    "%JDK_HOME%\bin\jarsigner" -keystore "%JINIT_HOME%\lib\security\keystore" -storepass jinitiator -keypass %JAR_KEY_PASSWORD% %1 %JAR_KEY%
    @echo Signing complete...
    Francois

  • Quest about a gui i'm trying to make that acts as a shell for  jar command?

    I try to create a jar file from a whole directory and the program locks up. It only locks up if there is a another directory inside that directory that is being archived. I added a System.out.println(command) to see if the command being sent is the correct one, and it is.. so there is something going on with the run-time or an exception.. i ran some debugging tests and it seem as if the problem happens at this line of code:
                        child.waitFor();
    but if i take that out.. i get another type of exception error which reads...
    Exception occurred during event dispatching:
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at JarFrame.jarCreate(JarFrame.java:659)
    at JarFrame.actionPerformed(JarFrame.java:330)
    at java.awt.Button.processActionEvent(Button.java:329)
    at java.awt.Button.processEvent(Button.java:302)
    at java.awt.Component.dispatchEventImpl(Component.java:2595)
    at java.awt.Component.dispatchEvent(Component.java:2499)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
    at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:10
    3)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
    but the program doesn't lock up when this happens... but also at this point no directory at all can be archived... not even one without another directory inside it... the code for the create command is at the bottom... the code at the bottom archives a directory if the directory does not have another directory inside it.. but locks up when there is another directory inside the directory that is being archived... distinguishing if the file to archive is a directory or a file is not problem for the jarCreate() method.. it is at the exception waitfor() where the problem occurs...
    PLEASE HELP!
    thanks,
    DiscoHristo
         /*     Runs the DOS Command for creating a JAR File     */
         public void jarCreate ( )
    createFieldText = createField.getText();
    String command;
    String output = new String ("Jar File Created");
    if (createFieldText.endsWith(".jar") == false)
         createFieldText = createFieldText.concat(".jar");
    if (selectedDirectory == null)
         command = "jar cvfM " + createFieldText + " " + directoryOfFile + selectedFile;
                   Runtime rt = Runtime.getRuntime();
                   try
                        Process child = rt.exec(command);
                        child.waitFor();
                        textBox.append(output + '\n');
                        System.out.println("Process exit code is: " + child.exitValue());
                   catch(IOException e)
                        System.err.println("IOException starting process!");
                   catch(InterruptedException e)
                        System.err.println("Interrupted waiting for process!");
         if (selectedDirectory != null)
              command = "jar cvfM " + createFieldText + " " + selectedDirectory;
              System.out.println(command);
         Runtime rt = Runtime.getRuntime();
                   try
                        Process child = rt.exec(command);
                        child.waitFor();
                        textBox.append(output + '\n');
                        System.out.println("Process exit code is: " + child.exitValue());
                   catch(IOException e)
                        System.err.println("IOException starting process!");
                   catch(InterruptedException e)
                        System.err.println("Interrupted waiting for process!");
         }

    Hello,
    Documentation says:
    The Runtime.exec methods may not work well for special processes on certain native platforms, such as native windowing processes, daemon processes, Win16/DOS processes on Win32, or shell scripts.
    Especially "may not work well" means that the behaviour of Runtime.exec is not documented in some "special" cases. Unfortunately I've same problem (unpredictable lock-ups) with Process.waitFor() in "standard environment" (Linux, J2SE 1.4, calling standard shell single processes). Could you be kind enough to let me know if you've found some solution?
    Thanks,
    Karel

  • Jar runtime problem

    Hi I have a jar file which function like this
    It Takes the data file from the folder and insert it into database now again next day it takes the data file(new one)
    and delete old data and insert new data.
    There is file handle.java which is need to be invoked to do all these functions
    Now question-
    1)only deploying jar file on server will work?
    2)if yes How to invoke this file under jar usind java command? command because it is linux
    Regards

    Your post makes almost no sense. Please try to explain the problem better.

Maybe you are looking for

  • Customer open items knock off on FIFO basis

    Friends, Is it possible to knock off the customer payments on first in first out basis, without manual clearing through F-32. Payments user will post the incoming payments on account, which should be adjusted for 1st bill on FIFO basis.  Just user ha

  • Post upgrade issues inSU25 2(B) step

    Hi , I have few query regarding this SU25 2(B) 1.This step will lists out all the transactions that are modified in older version from SAP Defaults.    I had observed that only the objects for which the modified flag is set in USOBX_C , there is a co

  • HR-ABAP PCH LDB

    Hi all, I want to get the latest record from 1007 infotype...hw can I do this using macros..?? I had used PNP LDB before...In that v hv RP_PROVIDE_FROM_FRST and RP_PROVIDE_FROM_LAST to get the first and latest records...Do v hv such macros in PCH..??

  • Update to 2.0.2

    I saw on Apple's page that 2.0.2 was available, so I plugged my phone in and hit update. iTunes told me that 2.0.1 was the latest version. I thought this was odd so I clicked it again: the same message. I double checked the page to see if I had the f

  • PAL / NTSC. Why can I Watch PAL DVD's in the US?

    I know when I burn a disc in iDVD I have the option to burn in PAL or NTSC. I'm in The USA and often send