Need help with jar files

I have made an application that uses the javax.comm library for serial port drivers. It works perfectely but when I put all the .class in a .jar and start the application it starts properly with no errors but it doesn't see the com's of the computer.
I would apreciate if you could help me out
greetings
paul

You have to modify the source code of the javax.comm class files you are using.. the line contains "package javax.comm;" should be deleted. And then compile those modified files and put the compiled files to your jar file. Or you can create a folder "javax" and subfolder "comm" in that folder and put those original .class files into "javax/comm". After that, put that "javax" folder into your jar file.

Similar Messages

  • Need help with Jar file

    I am writing an Application in Java using swing and all that good stuff but I am currently ready to do some beta testing to find any other errors.
    The problems is I want it to be easy to use so I was just going to throw the classes ina jar file so they could just run the jar files.
    For some reason I keep getting a cannot find main class error??
    Here is the manifest file for the Jar file
    Manifest-Version: 1.0
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    Main-Class: VRPServer.class
    VRPServer is the class that has the main in it.
    if I go to the command line and run I get
    E:\JAVA\VRP\Server>java -jar VRPServer.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: VRPServer/class
    if I double click the jar I get a pop-up saying "Could not find the main class, program will exit."
    I really don't understand Jar files all that well, I went through the tutorials but still can't see why this isn't working. Any help is appreciated. :)

    I think your problem is that you shouldn't add the '.class' to the name of your main class in your manifest; it should simply be the fully-qualified name of the class, for example:
    Manifest-Version: 1.0
    Created-By: 1.4.0_01 (Sun Microsystems Inc.)
    Main-Class: mypackage1.mypacage2.MyClassHope this is all it takes.
    Shaun

  • Need Help with .nnlp File.............A.S.A.P.

    I'm having a problem also with my JNLP file. I have downloaded the program onto one computer and that computer is using j2re1.4.2_04
    The other computers I believe are all running j2re 1.4.2_05
    I'm not sure if that's make a difference, but on the computer with j2re 1.4.2_05 when going to the site where the .jnlp file is located, the application comes up and says Starting Application. After it gets to that screen it just stays there. I really need help with this as soon as possible.
    Here is my .jnlp file listed below:
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp
      spec="1.0+"
      codebase="http://www.appliedsolutions.com/placewiz"
      href="Placewiz.jnlp">
      <information>
        <title>Placement Wizard 4.0</title>
        <vendor>Applied Solutions, Inc.</vendor>
        <homepage href="index.html"/>
        <description>Placement Wizard 4.0</description>
        <description kind="short">Short description goes here.</description>
        <offline-allowed/>
      </information>
      <resources>
        <j2se version="1.4+"/>
        <j2se version="1.3+"/>
         <j2se version="1.5+"/>
        <jar href="Placewiz.jar"/>
      </resources>
      <security>
          <all-permissions/>
      </security>
      <application-desc main-class="com/asisoftware/placewiz/loader/Exec">
    </jnlp>

    This was due to a change in 1.4.2_05
    the main class attribute
    main-class="com/asisoftware/placewiz/loader/Exec">is wrong - it should be:
    main-class="com.asisoftware.placewiz.loader.Exec">this didnt seem to mater before 1.4.2_05, but some change in java since then caused this bad class specification to stop loading.
    /Andy

  • Need help with connecting file inputs to arrays

    In this assignment I have a program that will do the following: display a list of names inputed by the user in reverse order, display any names that begin with M or m, and display any names with 5 or more letters. This is all done with arrays.
    That was the fun part. The next part requires me to take the names from a Notepad file, them through the arrays and then output them to a second Notepad file.
    Here is the original program: (view in full screen so that the code doesn't get jumbled)
    import java.io.*;       //Imports the Java library
    class progB                    //Defines class
        public static void main (String[] arguments) throws IOException
            BufferedReader keyboard;                                  //<-
            InputStreamReader reader;                                 //  Allows the program to
            reader = new InputStreamReader (System.in);               //  read the the keyboard
            keyboard = new BufferedReader (reader);                  //<-
            String name;                 //Assigns the name variable which will be parsed into...
            int newnames;               //...the integer variable for the amount of names.
            int order = 0;              //The integer variable that will be used to set the array size
            String[] array;             //Dynamic array (empty)
            System.out.println (" How many names do you want to input?");   //This will get the number that will later define the array
            name = keyboard.readLine ();
            newnames = Integer.parseInt (name);                                         // Converts the String into the Integer variable
            array = new String [newnames];                                               //This defines the size of the array
            DataInput Imp = new DataInputStream (System.in);       //Allows data to be input into the array
            String temp;                                       
            int length;                                                                  //Defines the length of the array for a loop later on
                for (order = 0 ; order < newnames ; order++)                                //<-
                {                                                                           //  Takes the inputed names and
                    System.out.println (" Please input name ");                            //  gives them a number according to
                    temp = keyboard.readLine ();                                           //  the order they were inputed in
                    array [order] = temp;                                                  //<-
                for (order = newnames - 1 ; order >= 0 ; order--)                                //<-
                {                                                                                //  Outputs the names in the reverse 
                    System.out.print (" \n ");                                                   //  order that they were inputed
                    System.out.println (" Name " + order + " is " + array [order]);             //<-
                for (order = 0 ; order < newnames ; order++)                                  //<-
                    if (array [order].startsWith ("M") || array [order].startsWith ("m"))     //  Finds and outputs any and all
                    {                                                                         //  names that begin with M or m
                        System.out.print (" \n ");                                            //
                        System.out.println (array [order] + (" starts with M or m"));         //
                    }                                                                         //<-
                for (order = 0 ; order < newnames ; order++)                                            //<-
                    length = array [order].length ();                                                   //
                    if (length >= 5)                                                                    //  Finds and outputs names
                    {                                                                                  //  with 5 or more letters
                        System.out.print (" \n ");                                                      //
                        System.out.println ("Name " + array [order] + " have 5 or more letters ");      //<-
    }The notepad file contains the following names:
    jim
    laruie
    tim
    timothy
    manny
    joseph
    matty
    amanda
    I have tried various methods but the one thing that really gets me is the fact that i can't find a way to connect the names to the arrays. Opening the file with FileInputStream is easy enough but using the names and then outputing them is quite hard. (unless i'm thinking too hard and there really is a simple method)

    By "connect", do you just mean you want to put the names into an array?
    array[0] = "jim"
    array[1] = "laruie"
    and so on?
    That shouldn't be difficult at all, provided you know how to open a file for reading, and how to read a line of text from it. You can just read the line of text, put it in the array position you want, until the file is exhausted. Then open a file for writing, loop through the array, and write a line.
    What part of all that do you need help with?

  • Urgent help with jar file

    I'm writing a program in VB that calls on a JAR file. It has been working great for weeks. Last night, I moved the JAR file to a new location on my machine, and it suddenly stopped working at all.
    I know nothing about Java. Do I need to recompile the file? I tried moving the whole directory back to its original location but it didn't help.
    Thanks in advance.

    Dude I'm telling you straight up, the program has a bug. The evidence is in the error message. Maybe the bug was not manifested before, but it was there.
    Do you have access to the source? Do you know how to compile it? You should recompile it with the -g flag to include debug information. Then the error message will include a method name and line number for the offending portion of code. If you're not able to figure it out yourself, you could post that portion of code here for someone to comment on.

  • I need help with viewing files from the external hard drive on Mac

    I own a 2010 mac pro 13' and using OS X 10.9.2(current version). The issue that I am in need of help is with my external hard drive.
    I am a photographer so It's safe and convinent to store pictures in my external hard drive.
    I have 1TB external hard drive and I've been using for about a year and never dropped it or didn't do any thing to harm the hardware.
    Today as always I connected the ext-hard drive to my mac and click on the icon.
    All of my pictures and files are gone accept one folder that has program.
    So I pulled up the external hard drive's info it says the date is still there, but somehow i can not view them in the finder.
    I really need help how to fix this issue!

    you have a notebook, there is a different forum.
    redundancy for files AND backups, and even cloud services
    so a reboot with shift key and verify? Recovery mode
    but two or more drives.
    a backup, a new data drive, a drive for recovery using Data Rescue III
    A drive can fail and usually not if, only when
    and is it bus powered or not

  • Help with JAR Files

    OK, folks, I need some help here...
    And I have researched on this prior to this post, but I still don't get it.
    I have a simple application in Reminder.java file. When I compile it, I get Reminder.class and Reminder$ReminderThread.class, because I have an inner class.
    I place those files in Reminder directory. I want to make an executable JAR file, so I made a manifest file outside the Reminder directory that contains these lines
    Manifest-Version: 1.0
    Main-Class: Reminder.Remindersince the Reminder.class is within the Reminder directory, I understood I had to have a prefix "Reminder."
    In the command line, I type
    jar cmf manifest Reminder.jar Reminder/Reminder.class Reminder/Reminder$ReminderThread.classAnd I do get a Reminder.jar file, but when I double-click on it, I get a popup saying "Could not find the main class. Program will exit!"
    So, what am I doing wrong and how can I fix this? As I said, I have researched, but I can't understand what went wrong nor how to fix the problem.
    Any help will be greatly appreciated.

    Never mind, I solved it, I was missing a carriage return in my manifest file. I feel so stupid now...

  • Need help about jar file again!!

    I want to make some of my package used as library. And also put my application into executable jar file. I edited following codes:
    uner path: D:\dd\b\b1
    package b.b1;
    public class Son
         int x = 10;
         public Son(){
         public int getX(){
              return x;
    under path D:\b\b2
    package b.b2;
    import b.b1.Son;
    public class Father
         public Father(){
         public static void main(String[] args)
              Son son = new Son();
              System.out.println("Hello World!"+son.getX());
    Then I used jar tool make two jar files and also make one of then has specified main class Manifest.mf.
    Here is my steps:
    D:\bb>edit kk.txt
    D:\bb>jar cmf kk.txt father.jar .\b\b2
    D:\bb>jar cf son.jar .\b\b1
    D:\bb>java -jar -classpath .;son.jar father.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: b/b1/Son
    at b.b2.Father.main(Father.java:13)
    I really do not know what's going on?
    Interesting thing is I can get this result:
    D:\bb>java -classpath .;son.jar b.b2.Father
    Hello World!10
    And if the father.jar does not depend on son.jar,
    it is also works.
    Thanks in advance.

    I believe when you run with the -jar option, the classpath setting is ignore and you have to specify classpath in the manifest file.
    From JDK Doc:
    Class-Path :
    The value of this attribute specifies the relative URLs of the extensions or libraries that this application or extension needs. URLs are separated by one or more spaces. The application or extension class loader uses the value of this attribute to construct its internal search path.
    Sounds like you can specify a different path than the current directory, but you have to know beforehand what that path is.

  • Now what? Help with .jar files

    Hey. I just finished a program. I want to share it with my friends or anyone else. I can create a .jar file but I have no idea what to do next. Is there an easy way to "publish" your programs (like create a .exe file?). Any help or ideas would be appreciated. Thanks, Merlot14

    java -jar MyFile.jarwill work if you've set your manifest correctly. If you're distributing only to Windows users, you could include a shortcut, I believe. Similarly, for distribution to Linux/OS X users, you could include a shell script.

  • Newbie help with JAR files

    Okay,
    I built a simple Hello World project with Swing and it worked. Now I've build my own program from scratch and get a "Cannot find the main class" error from the JRE. Below are the contents of the manafest file craeted by Sun Java Studio 8.
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.2
    Created-By: 1.5.0_06-b05 (Sun Microsystems Inc.)
    Main-Class: localPkg.mainForm
    X-COMMENT: Main-Class will be added automatically by build
    Also here is the source code for localPkg.mainForm
    * mainForm.java
    * Created on January 17, 2006, 9:32 AM
    * @author rowen
    package localPkg;
    import java.beans.*;
    public class mainForm extends javax.swing.JFrame {
    /** Creates new form mainForm */
    public mainForm() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;
    ctoF1 = new MyBeans.CtoF();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    numericField1 = new magicbeans.NumericField();
    numericField2 = new magicbeans.NumericField();
    ctoF1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
    public void propertyChange(java.beans.PropertyChangeEvent evt) {
    ctoF1PropertyChange(evt);
    ctoF1PropertyChange1(evt);
    getContentPane().setLayout(new java.awt.GridBagLayout());
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jLabel1.setText("Farenheight");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.ipadx = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(20, 110, 0, 0);
    getContentPane().add(jLabel1, gridBagConstraints);
    jLabel2.setText("Celsius");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(11, 110, 0, 0);
    getContentPane().add(jLabel2, gridBagConstraints);
    numericField1.setText("farenheightField");
    numericField1.setName("farenheightField");
    numericField1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
    public void propertyChange(java.beans.PropertyChangeEvent evt) {
    numericField1PropertyChange(evt);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = 4;
    gridBagConstraints.ipadx = 119;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 110, 0, 160);
    getContentPane().add(numericField1, gridBagConstraints);
    numericField2.setText("celsiusField");
    numericField2.setName("celsiusField");
    numericField2.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
    public void propertyChange(java.beans.PropertyChangeEvent evt) {
    numericField2PropertyChange(evt);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.ipadx = 99;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 110, 191, 0);
    getContentPane().add(numericField2, gridBagConstraints);
    pack();
    // </editor-fold>
    private void numericField2PropertyChange(java.beans.PropertyChangeEvent evt) {                                            
    ctoF1.setC(numericField2.getValue());
    private void numericField1PropertyChange(java.beans.PropertyChangeEvent evt) {                                            
    ctoF1.setF(numericField1.getValue());
    private void ctoF1PropertyChange1(java.beans.PropertyChangeEvent evt) {                                     
    numericField2.setValue(ctoF1.getC());
    private void ctoF1PropertyChange(java.beans.PropertyChangeEvent evt) {                                    
    numericField1.setValue(ctoF1.getF());
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new mainForm().setVisible(true);
    // Variables declaration - do not modify
    private MyBeans.CtoF ctoF1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private magicbeans.NumericField numericField1;
    private magicbeans.NumericField numericField2;
    // End of variables declaration
    Using Sun Java Studio Enterprise 8 (patch 1), on Windows XP (most recent patches)
    Thanks in advance,
    Roy

    R_Owen ,
    One possible way of how to do it in JSE8 is:
    1. Put all necessary lib jars to some place under src folder.
    2. Add those jars into Compile-time libraries list (Project properties -> Libraries) for correct compilation
    3. Switch to 'Files' JSE8 tab, open manifest.mf file (it's in projects root) and add your lib jars to it.
    Syntax is:
    Class-Path: relative URLs
    That's it.
    And Class-Path attribute description from JAR File Specification:
    http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Main%20Attributes:
    �Class-Path:
    The value of this attribute specifies the relative URLs of the extensions or
    libraries that this application or extension needs.
    URLs are separated by one or more spaces.
    The application or extension class loader uses the value
    of this attribute to construct its internal search path. �
    Copy/paste from:
    http://swforum.sun.com/jive/thread.jspa?forumID=122&threadID=60169

  • Need help with jar in jar

    Hi folks, I've got a serious(for me!) problem. I have a programm which contains several other jar files in a directory. If I run the program with Eclipse it works quiet well but if I create a Jar file from the whole program I always get the error message: No class def found error. It's the classes used from the included jar files that could not be found. So what should I do? In the jar file are all used class and jar files. Everything is there in the right order. But it doesn't work.
    I hope you can help me with that. One idea was that these other jar files have to be added to the manifest.mf ?! I've got no idea.

    For me it workes like this:
    manifest.mf:
    Manifest-Version: 1.0
    Main-Class: gui.testgui
    Class-Path: lib/castor.jar lib/xercesImpl.jar lib/xml-apis.jar
    I make my jar:
    jar cvfm myjar.jar manifest.mf .
    The dot stands for the directory where I am. All files and directories of this directory are jared.
    The information in my manifest-file are used to generate a manifest for the jar.

  • 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.

  • Need help with manifest file

    When I created a jar file with the -m option to insert a list of Name headers in my manifest file, only the last one in the list shows up in the manifest file when I unjar it. What am I doing wrong?

    i have used
    jar command it takes whatever specified in your own manifest information file into the meta-inf 's manifest file
    use jar -cvfm jarfile.jar maniinfofile.txt files.*
    hope it helps !!

  • Help with jar files and running them

    I have been trying to figure out how to run executable java files, now I have heard that a million and one people have asked this already. Though when I see the answer to these questions I am still quite confused, I would like to understand some things. First thing is how do you even save your java code as a jar file. Secondly, what is a jar file. Thirdly, I have seen many people talking about batch files, what are they? And finally, I have used many "wrappers" and I still cannot get it to work. Plz help

    A quick google search gave me [url http://neptune.netcomp.monash.edu.au/JavaHelp/howto/jar.htm]this website about jars.

  • Need help with backup files made by HP Recovery.

    So in 2011 I had made a post about a DV9 series HP laptop I had that I felt needed a harddrive. Well the laptop has been sold to a friend of mine and he has since fixed the issue it had. My curent deboggle is trying to deal with the 36GB of data it backed up onto an external USB powered harddrive. The information was saved from a system that ran Windows VISTA, on that same DV9 Pavilion. I have a new laptop and it's a Pavilion DV6 running windows 7. Is there some sort of 3rd party application or an uncommon HP utility that can open, run or modify. Specificaly I need to some files but not all, but if my only option is to extract all then that would be fine also. There is an executible in the backup folder but it doesn't extract anything it just locks up. 
    For the TLR portion, need to access backup files made on an older HP laptop with windows vista to a newer HP latop running windows 7.

    Terribly sorry for the post, I should have researched more before posting. I found the answer to my issue in another thread here on the HP forums! Thanks so much!!

Maybe you are looking for

  • I cannot connet to app store using wifi in the library

    I have recently been in the local library to connect to the app store via wi fi as this is required for some apps but i cann connect to i tunes or the app store, i can connect to the net BBC i player etc. Does anyone know why i cannot connect

  • Issues Acrobat Pro 9 and Word XP(2002)

    We installed Acrobat Pro version 9 a couple of weeks ago, and began experiencing problems with a couple of our VB.NET apps that invoke Word 2002. Basically, it appears that the presence of Acrobat Pro 9 causes Word 2002 to stop interacting with some

  • LR 1.4.1 not saving print settings on Mac OS 10.5.2

    1.4.1 won't save (or use) any print settings other than "Standard". In the print module if I select print settings, choose a printer and it's settings (like paper type and color management) then close the dialog the settings aren't saved or even used

  • Tax Requirement - with different base value

    Hi, We have material (Service) for which the tax calculation should be as follows: If the quantity is 6, say the per unit value is 100 $. Then the first 4 will have tax calculation of 15 % (GST) on 100 $  and the rest of 2 will have 60 % of total val

  • OBIEE11g1.5 External Table Authorization

    Hi, I have integrated LDAP for authentication. But for roles I have created an external table and by initialize block, I am populating it dynamically. My cache is disabled in NQSConfig file and Cache is unchecked in initialize block also. It is popul