Jar file in netbeans

I created a gui in netbeans and it runs but when I click on the jar file in my dist folder nothing happens. I try to run it from command prompt and still nothing happens, not even an error message. Whats the problem?

No main class. Or the wrong class is identifed as main.
http://java.sun.com/docs/books/tutorial/deployment/jar/

Similar Messages

  • How can I get a single jar file with NetBeans?

    How can I get a single jar file with NetBeans?
    When I create the project I get these files:
    dist/lib/libreria1.jar
    dist/lib/libreria2.jar
    dist/software.jar
    The libraries that have been imported to create the project are in separate folders:
    libreria1/libreria1.jar
    libreria2/libreria2.jar
    libreria1, libreria2, dist folders are all located inside the project folder.
    I added the following code to the build.xml:
    <target name="-post-jar">
    <jar jarfile="dist/software.jar">
    <zipfileset src="${dist.jar}" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria1.jar" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria2.jar" excludes="META-INF/*" />
    <manifest>
    <attribute name="Main-Class" value="pacco.classeprincipale"/>
    </manifest>
    </jar>
    </target>
    Of course there is also the project folder:
    src/pacco/classeprincipale.form
    src/pacco/classeprincipale.java
    Can you tell me what is wrong? The error message I get is as follows:
    C:...\build.xml:75: Problem creating jar: archive is not a ZIP archive BUILD FAILED (total time: 2 seconds)

    This is not a NetBeans forum, it is a JDeveloper forum. You might want to try http://forums.netbeans.org/. I also saw your other question - try looking in the New to Java forum: New To Java

  • How to include JAR file in NetBean library?

    i have downloaded JavaMail jar file and now i want to include this file into NetBean library. pls help me out.

    You can add the jar file to Netbeans as an external library by choosing 'Tools' on the menu bar and then selecting 'Library Manager'. In there you can give it a name and the path to the jar file. Once it is setup, if you go to your project properties, and click the 'Libraries' option on the left you will be able to add it. Select 'Add Library' and choose the one that you just created, it will now be part of your project.
    Alternatively, if you don't want to set it up as a library in Netbaeans, go straight to the project properties, select 'Libraries' and then select the 'Add Jar/Folder' option, now you can navigate to your jar file and add it to your project.
    For other info about JavaMail: http://java.sun.com/products/javamail/FAQ.html#install

  • Creating an exacutable jar file in netbeans

    Hey, how can i create an exacutable jar file in netbeans ?

    i guess you already have a project created, if you don't create a new java application project.
    Then you need to do the following:
    1. Set the main class. This is the class that will run first.
    for this you need to right click in the project node, select properties, then run and in the Main Class field put the main class.
    2. Set the classpath: you need to put all the libraries or resources you use in your project.
    to do that right click the libraries node, select properties, then add library and add all the libraries that your project needs
    by doing this steps netbeans will create your manifest file and the jar that will create will be executable.
    Hope this helps.
    Escobar5

  • Adding jar file in my gerareted jar file using netbean 4.0

    Hi,
    I write an application de process XML file using JDOM. I add the JDom package jar file to my project and everything work fine. But when I generate, my project jar file using netbean 4.0, my generated jar, is not working with the XML files anymore. Everything seems like it didn't include the JDOM jar file?
    Thanks for any help to fix the problem.

    I find that you can not use command-line such as java -classpath add classpath
    it can not work, I use netBeans4.0 i don't whether because of netbeans or java itself.
    you can add classpath in jar's Manifest.mf file
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.2
    Created-By: 1.5.0_01-b08 (Sun Microsystems Inc.)
    Main-Class: chat.Main
    // add this line
    Class-Path: dir\*.jar //(jar file name)
    X-COMMENT: Main-Class will be added automatically by build

  • How  to include the inner classes in a jar file in netbeans ide

    Dear java friends
    how to say to netbeans ide that it has to include the
    inner classes in the jar file.
    (i have one single applet class
    with two inner classes that show up
    in the build/classes file but not in the jar).
    The applet works in the viewer but not
    in the browser (I believe because the
    xxx$yyy etc should be in the jar)
    willemjav

    First, please stop posting the same question multiple times:
    Duplicate of http://forum.java.sun.com/thread.jspa?threadID=5269782&messageID=10127496#10127496
    with an answer.
    Second, If your problem is that you can't do this in NetBeans, you need to post to somewhere that provides NetBeans support - like the NetBeans website's mailing list. These forums do not support NetBeans (or any other IDE) - they are Java language forums.

  • Libraries and JAR files in netbeans... how to build and deploy a project??

    Hi guys,
    <p>
    I'm having a problem deploying my project. I have created a project structure as so:
    </p>
    <p>
    CLOGE 1.0
    |_Source Packages
    |  |_rdemo
    |    |_ClogeGUI.java [main]
    |    |_ClogeRScript.java
    |_Libraries
       |_Swing Layout Extensions - swing-layout-1.0.jar
       |_C:\CLOGE\JRclient [folder structure of classes]
       |  |_META-INF
       |  |_org.rosuda.JRclient
       |_C:\CLOGE\svgSalamander-tiny [folder structure of classes]
       |  |_META-INF
       |  |_com.kitfox.svg
       |  |_...
       |_JDK 1.6 (Default)
    </p>
    <p>
    Now I can build and run the project in Netbeans (version 5.5) and everything operates as it should. However, if I navigate to the dist folder of the project to the CLOGE_1.0.jar file via the Windows XP Command Prompt and execute "java -jar "CLOGE_1.0.jar", I get this error:
    </p>
    <p>
    Exception in thread "main" java.lang.NoClassDefFoundError: org/rosuda/JRclient/RSrvException<br/>
      at rdemo.ClogeGUI.clogeRScript(ClogeGUI.java:134)<br/>
      at rdemo.ClogeGUI.main(ClogeGUI.java:259)<br/>
    </p>
    <p>
    What do I have to do, so I can simply double-click the CLOGE_1.0.jar file and the project runs?
    </p>
    <p>
    Many thanks,<br/>
    Chris
    </p>
    Edited by: raistrick on Oct 12, 2007 4:49 AM

    Wasn't contracted. Wasn't paid. Wasn't the main focus of the software ;) - I was asked to do it for my technical expertise in statistics and bioinformatics... anyone else here mind giving me some hints other than this unspeakably pathetic excuse for a programmer.
    (by the way "jwenting", if you call yourself a professional and take that attitude to other programmers you won't be in a company very long! Don't jump to assumptions and don't use the internet as some portal to exercise anger that women don't find you attractive and all you have to be cocky about is programming, it's pathetic. Grow up please.
    What I am trying to work out about the answer above, is why. It could mean (1) that you don't know the answer and shunning me so is some poor attempt to save your diminishing ego, which from reading your other posts may be true. It could mean (2) you can't be arsed, which is more likely the case, but then one has to ask why the hell you came on here in the first place. Do you get a kick out of this? Is this your claim to fame - a java forum silver member?? It's not like I wasn't polite or clear in my explanation. Did some unqualified individual steal your job from you once upon a time so all "newbies" thereafter were a target for your pent up aggression? If so, don't worry I am not gunning for your position at all!)
    Many thanks to anyone who can provide a solution. I doubt this is a hard problem to solve and I'd be very grateful if anyone could point me in the direction of an answer. jwentig is quite right, I am not capable of such a task. I'm not a liar, however.
    Edited by: raistrick on Oct 12, 2007 7:25 AM

  • Jar file from netbeans won't run when doubleclicked

    Hello,
    I've just completed my first java application using netbeans (just a simple "hello world"), it runs fine in the netbeans ide, but when I located the .jar file and double clicked it, nothing happens. I've already verified that the file extension .jar is associated with javaw.exe so that's not the problem.
    Anyone how to fix this problem?
    Thanks!
    Edited by: b-rad311 on Jul 14, 2010 8:44 AM

    My guess is he posted something and then edited it and put in nvm for NeVer Mind.
    In NetBeans I would try this to make sure the main class setting is fully saved with new version of NetBeans
    press Ctrl+1 to go to projects tab
    Right click your project click Properties
    on left click Run
    Make sure you don't have anything in Arguments or VM Options because javaw will read use either of these settings.
    Click Browse next to Main Class and click your class again and click Select Main Class. Then click OK to rewrite the settings.
    Right click your project and do "Clean And Build".
    Let us know if this works or not

  • Can Netbeans put a jar file In a jar file?

    I just went through the process of getting Eclipse to create a jar file that would execute from a command prompt using a plugin called fatjar :
    http://fjep.sourceforge.net/
    Details from other thread :http://forum.java.sun.com/thread.jspa?threadID=5219638&tstart=0
    I really would like to use netbeans but i now have the exact same problem trying to make a jar file in netbeans 5.5.1
    I am using a package from icaste.com It has a
    .dll file to put in the windows directory
    JCommSerial_3_0.jar file that contains all the classes
    I can compile and run a file in the IDE and it works fine
    The Jar file does not contain the classes so i get errors when running from command line.
    Here is the layout of my screen and result of run command in IDE
    http://www.acousticlights.com/netbeans.png
    What do I need to try?

    georgemc wrote:
    Why is everyone so obsessed with doing this? The gains are minimal and the problems numerousBecause we are new and don't understand how the java VM actually runs code and the error messages sent by the java machine are cryptic.
    My first attempt at using an external jar in a java program lead me to believe that all of the code for a java program would be in a jar file including external jar files, after all the JDK standard library has tons of jars in it so I assumed the external jar file would be linked (as most other programming compiler/linkers I have worked with in my top down programming life).
    I find out the answer is so simple that the external jar file could not be found by the VM running my jar file. Like I said, if the VM would have just gave me an error that it could not find a file on a specific directory i never would have perused the idea of jar in a jar (fatjar plugin for Eclipse for example)
    Really this is like getting into a race car and not knowing at what RPM to shift gears, sure you can press the pedal and make it go but if you don't understand how it works under the hood you are going to blow the engine if you keep it in first gear.
    I have read many posts on these errors, the reason is the error message is just not very descriptive of the original problem. If I try and open a database called xyz.dbf that has one field defined as lastname, in C for example, I would not give the error message "Lastname could not be found) when indeed the lastname could not be found but the reason it could not be found was because the database xyz.dbf could not be found. Further , adding to the error message that the system is looking for xyz.dbf on drive X- subdirectory -mydatabases would complete the error message and allow the user to fix the error. Just what is a non java programmer that is using my java program suppose to do with an Ecception Error in (main) bla bla bla... I know now I need to check for library files myself within my own java programs and give a better error message to the user before the java VM sends out it's cryptic message.
    Edited by: metron9 on Sep 25, 2007 11:00 AM

  • Error with running JAR files created with NetBeans

    I have been having difficulty running the JAR files that NetBeans compiles. When I run my code from NetBeans, it always works just fine, but when I try to run the compiled JAR I get the following errors:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass2(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:719)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:160)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:254)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    This is happening for multiple projects now, though I don't remember it happening before. What am I doing wrong? Why is this happening? How can I fix it? Thank you for any insights...

    Oh, I forgot to mention, all the NetBeans samples work, just not apps that I create. This is very frustrating!

  • ANT how to include NetBeans Jar  files in my script of ANT ??

    ANT how to include NetBeans Jar files in my script of ANT ??

    I mean the library say swing layout ...
    which is SwingLayOuts1.0.jar ...
    in side this there is folder org.jDesktop....
    I want this folder in my jar file ...
    also ....
    My question ... i know the path of the jar file of NetBeans .... i can copy that ...dirctly ... but if m using Netbeans editor ... can i give NetBeans class to my jar command for ANT...........

  • Unable to run jar file without lib folder containing swing-layout-1.0.jar

    I have done my project through NetBeans 5.0. Eventhough I have copied my lib foloder containing swing-layout-1.0.jar inside my project.jar, I am still unable to run my project.jar in other systems, it is creating an error as Could not find the main class. Program will exit. But if I copy the lib foloder containing swing-layout-1.0.jar in the same path as the project.jar, then my project.jar is running.
    But I want to give only the project.jar for other users and not also lib foloder containing swing-layout-1.0.jar each time.
    Could someone please help me with this.

    When you develop GUI applications using the Netbeans you may endup using netbeans specific jar files in your auto generated code.
    And when you build jar files with netbeans it copy the third party jar files used in a application in to a lib folder in the same directory as the jar file of your project. And then set a class path entry to those jar files in your project jar file's manifest file.
    So if you want to redistribute the package you have to redistribute your jar file and every thing in the lib folder in with the same directory structure.
    If you want to change the structure you will have to change the class path to suit the new structure.

  • Including web service jaras in final jar file

    Hello all.
    Im using netbeans 4.0. I have used JAXB code in my program, ie. Ive used a few packages I created with the XJC compiler so i can unmarshall some XML documents. I have included the four JAXB Jar files from the Java Web Services Developer Pack in my project by including them in the projects "Classpath for compiling sources". This works fine when running in netbeans. But when I try running the project outside netbeans by double clicking on the generated JAR file I get a
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    Im guessing this is because it can't see the jaxb jar files when not run from within netbeans. How would I include the jaxb jars in the jar file that netbeans generates?
    I know this is partly an IDE related question but I thought it must be a fairly common problem when creating JAR files so i posted it here.
    Any help is appreciated.
    thanks

    Im guessing this is because it can't see the jaxb jar
    files when not run from within netbeans. How would I
    include the jaxb jars in the jar file that netbeans
    generates? You wouldn't include them in that jar file. You would include Class-Path entries (which refer to the jaxb jars) in the manifest of the jar file that Netbeans creates.
    Don't ask me how to do that, I don't use Netbeans. I assume that Netbeans must support it somehow, but if you can't find out how then a Netbeans forum would be a good place to ask.
    I know this is partly an IDE related question but I
    thought it must be a fairly common problem when
    creating JAR files so i posted it here.

  • Editting and re-jarring Jar files

    Hi.
    I've taken over someone else's code and I can't, for the life of me, figure out how to open the jar file in NetBeans for instance, edit some of the classes and jsp's, and then re-jar everything to deploy it.
    Thanks in advance for any help.
    Jeremy.

    Yeah, kinda like I already said over on your crosspost. Now you're just plain annoying for crossposting this.

  • Bulid Jar file

    Hello
    i made a simple project in netbeans and even i bulid a jar file but problem is when i open jar file in command prompt i got error exception in thread main
    please anybody tell me how can i remove this error?
    Thanks

    You can create jar file using netbeans simply by clicking bulid button but first change mainfest file
    mainfest file should like
    mainfest version 1.0
    Class name: name of class
    one more thing is you should include all external libariers which you use in out project
    but if you got stil error like me then use ant for bulidng like i do
    thanks

Maybe you are looking for

  • Com.sun.tools.javac.Main: method compile errors

    I had a working web project the other day, and something happened that caused every page to start throwing this error: # javax.servlet.ServletException: com.sun.tools.javac.Main: method compile([Ljava/lang/String;Ljava/io/PrintWriter;)I not found # a

  • Accounting Document was not generated

    Hi Friends, While doing Post goods issue, Material document was created but system does not create accounting document. One sales order having two items (10&20) Both iteams having same material In case of items number 10(system generate accounting do

  • Large attachments files in SOAP messagges

    Hi all, i�m wondering if it is possible to attach files (like .pdf .doc ) on SOAP messages, i.e. when you receive a mail with attachments parse this with the help of email BC and save it to system file with File BC Is this make any sense? thanks in a

  • Unfortunately camera has stopped

    Hi My Z1 Compact camera has stopped working - I used it yesterday with no problem, but today tried to launch it today and now get a message saying "Unfortunately camera has stopped". no other camera apps work either so it must be the main camera app

  • CRSXI: Problem Executing .vbs

    Simple .vbs (which has no problem running directly when clicked)...but in CRS XI get: Server Used: r2crny01.programjobserver  Error Message: An unknown COM error has occurred while trying to run the script.  Not familiar with COM issues - and this is