Adding JAR file to project

Hi All
How can i add jar to my project environment.
Actually what i did was.
Created one folder called "JavaWork" like d:\JavaWork
and put the jar file into this folder and wrote a test class which is importing some classes from the jar file.
how to use jar ? Please someone help me.
Thanks in advance
Shan

`man jar`
jar(1) jar(1)
NAME
jar - Java archive tool
SYNOPSIS
jar [ -C ] [ c ] [ f ] [ i ] [ M ] [ m ] [ O ] [ t ] [ u ]
[ v ]
[ x file ] [ manifest-file ] destination input-file
[ input-files ]
DESCRIPTION
The jar tool is a Java application that combines multiple
files into a single JAR archive file. It is also a gen-
eral-purpose archiving and compression tool, based on ZIP
and the ZLIB compression format. However, jar was
designed mainly to facilitate the packaging of Java
applets or applications into a single archive. When the
components of an applet or application (.class files,
images and sounds) are combined into a single archive,
they can be downloaded by a Java agent (like a browser) in
a single HTTP transaction, rather than require a new con-
nection for each piece. This dramatically improves down-
load time. The jar tool also compresses files, which fur-
ther improves download time. In addition, it allows indi-
vidual entries in a file to be signed by the applet author
so that their origins can be authenticated. The syntax
for the jar tool is almost identical to the syntax for the
tar(1) command. A jar archive can be used as a class path
entry, whether or not it is compressed.
The three types of input files for the jar tool are:
o Manifest file (optional)
o Destination jar file
o Files to be archived
Typical usage is:
example% jar cf myjarfile *.class
In this example, all the class files in the current direc-
tory are placed in the file named myjarfile. A manifest
file is automatically generated by the jar tool and is
always the first entry in the jar file. By default, it is
named META-INF/MANIFEST.MF. The manifest file is the
place where any meta-information about the archive is
stored. Refer to the Manifest Format in the SEE ALSO sec-
tion for details about how meta-information is stored in
the manifest file.
To use a pre-existing manifest file to create a new jar
archive, specify the old manifest file with the m option:
example% jar cmf myManifestFile myJarFile *.class
When you specify cfm instead of cmf (that is, you invert
the order of the m and f options), you need to specify the
name of the jar archive first, followed by the name of the
manifest file:
example% jar cfm myJarFile myManifestFile *.class
The manifest uses RFC822 ASCII format, so it is easy to
view and process manifest-file contents.
OPTIONS
The following options are supported:
-C Changes directories during execution of the jar com-
mand. For example:
example% jar uf foo.jar -C classes *
c Creates a new or empty archive on the standard out-
put.
f The second argument specifies a jar file to process.
In the case of creation, this refers to the name of
the jar file to be created (instead of on stdout).
For table or xtract, the second argument identifies
the jar file to be listed or extracted.
i Generates index information for the specified jar
file and its dependent jar files. For example,
example% jar i foo.jar
would generate an INDEX.LIST file in foo.jar which con-
tains location information for each package in foo.jar and
all the jar files specified in foo.jar's Class-Path
attribute.
M Does not create a manifest file for the entries.
m Includes manifest information from specified pre-
existing manifest file. Example use:
example% jar cmf myManifestFile myJarFile *.class
You can add special-purpose name-value attribute
headers to the manifest file that are not contained
in the default manifest. Examples of such headers
are those for vendor information, version informa-
tion, package sealing, and headers to make JAR-bun-
dled applications executable. See the JAR Files
trail in the Java Tutorial and the JRE Notes for
Developers web page for examples of using the m
option.
O Stores only, without using ZIP compression.
t Lists the table of contents from standard output.
u Updates an existing JAR file by adding files or
changing the manifest. For example:
example% jar uf foo.jar foo.class
adds the file foo.class to the existing JAR file
foo.jar, and
example% jar umf foo.jar
updates foo.jar's manifest with the information in
manifest.
v Generates verbose output on stderr.
x file
Extracts all files, or just the named files, from
standard input. If file is omitted, then all files
are extracted; otherwise, only the specified file or
files are extracted.
If any of the files is a directory, then that direc-
tory is processed recursively.
EXAMPLES
To add all of the files in a particular directory to an
archive:
example% ls
0.au 3.au 6.au 9.au at_work.gif
1.au 4.au 7.au Animator.class monkey.jpg
e.au 5.au 8.au Wave.class spacemusic.au
example% jar cvf bundle.jar *
adding: 0.au
adding: 1.au
adding: 2.au
adding: 3.au
adding: 4.au
adding: 5.au
adding: 6.au
adding: 7.au
adding: 8.au
adding: 9.au
adding: Animator.class
adding: Wave.class
adding: at_work.gif
adding: monkey.jpg
adding: spacemusic.au
example%
If you already have subdirectories for images, audio
files, and classes that already exist in an HTML direc-
tory, use jar to archive each directory to a single jar
file:
example% ls
audio classes images
example% jar cvf bundle.jar audio classes images
adding: audio/1.au
adding: audio/2.au
adding: audio/3.au
adding: audio/spacemusic.au
adding: classes/Animator.class
adding: classes/Wave.class
adding: images/monkey.jpg
adding: images/at_work.gif
example% ls -l
total 142
drwxr-xr-x 2 brown green 512 Aug 1 22:33 audio
-rw-r--r-- 1 brown green 68677 Aug 1 22:36 bundle.jar
drwxr-xr-x 2 brown green 512 Aug 1 22:26 classes
drwxr-xr-x 2 brown green 512 Aug 1 22:25 images
example%
To see the entry names in the jar file using the jar tool
and the t option:
example% ls
audio bundle.jar classes images
example% jar tf bundle.jar
META-INF/MANIFEST.MF
audio/1.au
audio/2.au
audio/3.au
audio/spacemusic.au
classes/Animator.class
classes/Wave.class
images/monkey.jpg
images/at_work.gif
example%
To display more information about the files in the
archive, such as their size and last modified date, use
the v option:
example% jar tvf bundle.jar
145 Thu Aug 01 22:27:00 PDT 1996 META-INF/MANIFEST.MF
946 Thu Aug 01 22:24:22 PDT 1996 audio/1.au
1039 Thu Aug 01 22:24:22 PDT 1996 audio/2.au
993 Thu Aug 01 22:24:22 PDT 1996 audio/3.au
48072 Thu Aug 01 22:24:23 PDT 1996 audio/spacemusic.au
16711 Thu Aug 01 22:25:50 PDT 1996 classes/Animator.class
3368 Thu Aug 01 22:26:02 PDT 1996 classes/Wave.class
12809 Thu Aug 01 22:24:48 PDT 1996 images/monkey.jpg
527 Thu Aug 01 22:25:20 PDT 1996 images/at_work.gif
example%
If you bundled a stock trade application (applet) into the
following jar files,
main.jar buy.jar sell.jar other.jar
and you specified the Class-Path attribute in main.jar's
manifest as
Class-Path: buy.jar sell.jar other.jar
then you can use the i option to speed up your applica-
tion's class loading time:
example$ jar i main.jar
An INDEX.LIST file is inserted in the META-INF directory
which will enable the application class loader to download
the right jar files when it is searching for classes or
resources.
SEE ALSO
keytool(1)
JAR Files @
http://java.sun.com/docs/books/tutorial/jar/
JRE Notes @
http://java.sun.com/j2se/1.3/runtime.html#exam-
ple
JAR Guide @
http://java.sun.com/j2se/1.3/docs/guide/jar/index.html
For information on related topics, use the search link @
http://java.sun.com/
13 June 2000 jar(1)

Similar Messages

  • 10.1.3 - Problems adding existing files and projects

    I am having some very basic issues with the latest JDeveloper 10g (10.1.3) - Preview Release, all related to adding existing files and projects to JDeveloper.
    http://jdeveloper.us.oracle.com/
    http://jdeveloper.us.oracle.com/jdev_index.uix?bajaPage=menu=0%24menu_option=0%24tab=3
    http://jdeveloper.us.oracle.com/download/software/10g/1013Preview/jdevj2ee1013.zip
    Oracle JDeveloper 10g (10.1.3) - Preview Release, Nov-2004
    Version 10.1.3.0.2.223
    Build JTINTEG_MAIN_NT_041202.0854.223
    Setup JDeveloper
    ===============
    1) Unzip jdevj2ee1013.zip to c:\jdev101302_233
    2) Run c:\jdev101302_233\jdev\bin\jdev.exe
    3) Would you like to migrate from a previous version of JDeveloper? No
    Attempt to add a java file to a new Project
    ==========================================
    1) Right click on Applications and select New Application Workspace...
    2) Create Application
    Application Name: VTF_C
    3) Create Project
    Project Name: VTFclean
    4) Attempt to add a source file to the project
    a) File Open...
    Select a file.
    PROBLEM 1: File is opened, but is not automatically added to project and I am also not prompted with the 'Add Project Source Path' dialog.
    b) Attempt to drag/drop file onto VTFclean project
    Get 'Add Project Source Path' Dialog
    The project source path must be updated in order to add the selected file or files.
    Do you want to update the project source path? Yes
    PROBLEM 2: JDeveloper hangs
    Attempt to import a previous JDeveloper project
    ==============================================
    1) File Open...
    Select VTFclean.jpr and press 'Open' button.
    2) Create Application
    Application Name: VTF
    Press 'OK' button
    3) Open Warning
    You are about to migrate project C:\oracle\dss\vtf\build\VTFclean.jar to JDeveloper 10g Developer Preview release 10.1.3.0.2 file format.
    Once the project is migrated you will not be able to reopen it using an older version of JDeveloper. We will back up your project file, you may want to back up the project contents before proceeding.
    Do you want to migrate these files? Yes
    4) Migrating Progress Dialog displays
    Migrating files to JDeveloper 10g Developer Preview version 10.1.3.0.2 format....
    Problem 3: JDeveloper hangs whether initial project was based on 9.0.5.x or 10.1.2.x
    Questions:
    ==========
    1) Am I missing something obvious or are these simply bugs?
    2) Is there a particular reason why there is no reference to JDeveloper 10.1.2 on the http://jdeveloper.us.oracle.com website?
    3) Why were the 'Add to Applications...' and 'Add to Project...' buttons removed from the 'Applications - Navigator'?
    I found them very helpful and used them to add items to existing Applications and Projects.
    I have duplicated these problems on two different Windows XP systems. Neither JDeveloper 10.1.2 or 9.0.5 builds have exhibited these problems.

    Hi Shay,
    This dynamic project source feature is going to kill us! We have more than 15,000 files in our projects. Currently, part of them are managed by JDeveloper. Developers have option to load only the files they are working on. If all files in the project source will be loaded automatically, that will definitely be a nightmare to us. The JDeveloper will be frozen from time to time when it start to looking for new files...
    Think about why people pick Oracle instead of SQL Server - Oracle is good in handling large data. We, JDeveloper users, sincerely hope JDeveloper team can design/test the JDeveloper on large scaled project before formally release it.
    Thanks for your hard work though.
    Charles

  • 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 access files outside a .jar file netbeans project

    Hi, i need to access a file outside a built project inside netbeans. Ideally i would like this file next to the .jar file as myapp.properties. If possible i would like it so that when i am compiling and running the project in netbeans the file can be with the class files or something along those likes. Either way it would be nice to have different code for built projects and just running them outside a jar.
    Heres what i got so far
    properties = new Properties();
                InputStream in = this.getClass().getResourceAsStream("applications.properties");
                properties.load(in);
                in.close();this only works if the file is next to the classes. (think thats called the classpath ? )
    Thanks for any replies!!

    Your wrong code:
    properties = new Properties();
    InputStream in
    = this.getClass().getResourceAsStream("applications.properties");
    properties.load(in);
    in.close();A right code:
    // basic assumption 1: applications.properties
    //  is a pure ISO 8859-1 text file
    // basic assumption 2: the file applications.properties
    //  is stored in the same directory where your
    //  jar file is stored
    properties = new Properties();
    try{
      FileInputStream in      // assume current dir
       = new FileInputStream("applications.properties");
      properties.load(in);
      in.close();
    catch (Exception e){
      e.printStackTrace();
    }

  • How to add jar files in project?

    Hi everyone,
    Im stuck at one problem. I have third party API which are in jar files. I want to add reference those jar files in my projects. How to add all jar files at once in my project? Also, jar files are in different folders, like
    rootFolder
    {noformat} |- jar1.jar{noformat}
    |- jar2.jar
    |- Folder1
    | |-subjar.jar
    | |-subjar2.jar
    |- Folder2
    |- moreJars
    How to add all these jar files at once in my project? If u need more information, I will provide...
    Thanks in advance

    You can put the external references the in manifest of your own jar or you can do that at the bootstrap shell script.

  • How can we call a jar files(seperate projects jars) to each link of the tre

    how can we call a jar OR WAR files(seperate projects jars OR War) to each link of the tree.

    i want have home page that have this menu
    ========================
    -- Sale
    --- Customer
    --- Reader
    -- Energy
    --- Calc
    -- Service
    --- Chnage Name
    --- Change Code
    =======================
    For example
    --- Change Name
    ---- Page Reister
    ---- Page Confirm
    ---- Page Anoc
    ---- Page Save
    ======================
    i want user to access to every page From Each Case(Change Name) .
    i create for change name one project in my fushion web app and for other case
    How to I Can Call Page register From change name in Menu of The home page ????
    Edited by: user13151366 on Feb 4, 2013 4:44 AM

  • JAR file updating project config file error. Help needed!

    Hi all,
    I got a problem when I want to use an existed jar file. There is a method called setConfig which can read and update the properties inside a property file which will be located inside the deployed jar file. But when the other project want to use this jar file. It causes the following error:
    Property 'configfile' threw exception; nested exception is java.lang.IllegalArgumentException: URI is not hierarchical
    The code might cause this error is like:
    String temp = configfile.substring(CLASSPATH_IND.length()).trim();
    URL url = BaseConfigureFactory.class.getClassLoader().getResource(temp);
    try {
    tempcfg = (new File(url.toURI())).getAbsolutePath();
    } catch(URISyntaxException use) {
    throw new IllegalArgumentException(use);
    It seems like the url is wrong so that the program can not find the configfile. Does anyone give some suggestions? Thanks

    I have all of e.printStackTrack( ) in my try - catch block. But i also think the blank screen appears because the class can not find my resources. Maybe it's my fault, because i create by hand a folder name "res" in project folder, then put all my resource in this folder. And in Eclipse when i try to get these resource, i wrote something like this:
         Image robot1N, robot1E, robot1S, robot1W;
         private void initResources() {               
              try {               
                   String sb = "car1";
                   robot1N = ImageIO.read(new File("res\\img\\unit\\" + sb +"_N.png"));
                   robot1E = ImageIO.read(new File("res\\img\\unit\\" + sb +"_E.png"));
                   robot1S = ImageIO.read(new File("res\\img\\unit\\" + sb +"_S.png"));
                   robot1W = ImageIO.read(new File("res\\img\\unit\\" + sb +"_W.png"));
              catch(Exception e) {
                   e.printStackTrace();
         }Maybe the string of path to resource is right in Eclipse but wrong in Window?

  • Adding Jar files in another Jar file

    Hi,
    I have a very bad problem. Please some one help me here.
    I created a Java application which is organized in a package structure.
    The directories and files in the JAr files are following
    1) TestApplication.class - The application startup class.
    2) com(dir) - The start of my package structure, all the othere files are in this directory
    3) config (dir) - Directory containing all the configuration files.
    4) hsqlDatabase (dir) - contains the inprocess database
    5) images (dir) - Contains all the images used in the application.
    6) lib (dir) - Contains all the other jar files that i use in this application, i have about 10 of them in this directory.
    I created a jar file which contains all these dir and the TestApplication.class file. I also uses the 'Main-Class' and 'Class-Path' attribute.
    This is my META-INF\MANIFEST.MF file
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.1
    Created-By: 1.4.2_03-b02 (Sun Microsystems Inc.)
    Built-By: jj
    Main-Class: TestApplication
    Class-Path: .;./lib/commons-codec-1.3.jar;./lib/commons-httpclient-3.0
    -alpha1.jar;./lib/hsqldb.jar;./lib/kunststoff-2_0_1.jar;./lib/kunstst
    off.jar;./lib/liquidlnf.jar;./lib/log4j-1.2.8.jar;./lib/looks-1.2.2.j
    ar;./lib/jcalendar.jar;./lib/mysql-connector-java-3.0.9-stable-bin.ja
    r;./lib/ViolinStrings.jar;./config;./hsqlDatabase;./images
    When i try to run the application through
    java -jar xxxxx.jar
    1) the first problem is that it starts the application (TestApplication.class) and also loads the rest of the application in my package(com\...). But it cannot find the classes which are in the jar file (in the lib dir).
    2) I am also trying to read from a config\xxxxx.properties file, but i get an exception showing FileNotFound (xxxxx.properties).
    Hope that this will help you to help with my problem,
    Thanks in advance,
    Jobby

    1) the first problem is that it starts the
    application (TestApplication.class) and also loads
    the rest of the application in my package(com\...).
    But it cannot find the classes which are in the jar
    file (in the lib dir).
    jars inside of jars do not work like you want them too. You should be able to write a class loader that can find those other jars, but Java does not directly support jars inside of jars. Of course, you can unjar the other jars and use them as well.
    2) I am also trying to read from a
    config\xxxxx.properties file, but i get an exception
    showing FileNotFound (xxxxx.properties).
    Is this file also in the jar? If it is, you need to use getClass().getResource() to find the file.

  • Added JAR files are removing while Building

    Dear Gurus,
    I will explain my problem.
    I am developing a portal standalone application.There I have to read one Excel file.
    So I used 'jxl-2.6.jar' which was not available in the server.
    I have created one external library project and uploaded respective jar to server.
    I have checked the same in visual admin as per blog  "http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2361"
    and it was fine.
    Now my problem is if I build my project, it is showing the error in import statement.
    I have tried these all
    1) added that jar as used DC
    2) added the library project as project reference
    3) in Java build path i have added 'Add JARs'.
    When I am adding this no error but when i build, it will show error and it is removing this jars from Java build path.
    Thanks in advance,
    Ram

    The problem Solved.
    The issue was with assembly and compilation part while adding to public part.
    this link is having good info
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4512

  • Adding java projects in eclipse instead of jar files

    I have 2 java projects, one is in C:/test/ProjectA and another is C:/test/ProjectB
    Under projectA and ProjectB i have sub projects.
    I mainly work on ProjectB and import the jar of ProjectA in eclipse.
    Now I have removed jar file of ProjectA reference through eclipse and import projects to workspace, added projects under java build path. clean and build project. no compilation error in eclipse.
    when i do this, one of the class file is not getting loaded while server startup:
    07-Sep-2011 09:28:03 org.apache.catalina.loader.WebappClassLoader validateJarFile
        INFO: validateJarFile(C:\project\europa\NOS-OCT-TEST\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ESW\WEB-INF\lib\javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
        NOS 0    [main] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/ESW]  - Error configuring application listener of class com.bgc.ecm.core.web.listener.Log4jRemappingListener
        java.lang.ClassNotFoundException: com.bgc.ecm.core.web.listener.Log4jRemappingListener
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
    when i add relevant jar file to the project and do a clean build server is getting started as expected.
    But my changes are not reflecting since it is referring old jar file.
    I am using Tomcat server as development environment.
    What i want is instead of refering jar file in eclipse, add projects so that the new changes should reflect the changes without ant build for creating jar file and instead only with eclipse build with source code of the dependent project and run the application.

    847389 wrote:
    I have 2 java projects, one is in C:/test/ProjectA and another is C:/test/ProjectB
    Under projectA and ProjectB i have sub projects.
    I mainly work on ProjectB and import the jar of ProjectA in eclipse.
    Now I have removed jar file of ProjectA reference through eclipse and import projects to workspace, added projects under java build path. clean and build project. no compilation error in eclipse.If you have imported the depended jar, and if its a java project. the eclipse by default refer these while compiling. I mean before using either of the ant script the or build project option in eclipse. And because of this it is not giving error.
    >
    when i do this, one of the class file is not getting loaded while server startup:
    07-Sep-2011 09:28:03 org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\project\europa\NOS-OCT-TEST\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ESW\WEB-INF\lib\javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    NOS 0    [main] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/ESW]  - Error configuring application listener of class com.bgc.ecm.core.web.listener.Log4jRemappingListener
    java.lang.ClassNotFoundException: com.bgc.ecm.core.web.listener.Log4jRemappingListener
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
    And when you deploy the build app in tomcat it looks for the dependent jar/classes in lib or classses folder, and as it is not there the error is thrown.
    If you are using ant script then please specify which jar files to load in lib folder.
    when i add relevant jar file to the project and do a clean build server is getting started as expected.
    But my changes are not reflecting since it is referring old jar file.
    I am using Tomcat server as development environment.
    What i want is instead of refering jar file in eclipse, add projects so that the new changes should reflect the changes without ant build for creating jar file and instead only with eclipse build with source code of the dependent project and run the application.If you want this, then write ant script compatible of loading both the jar's.
    Or you can make the ant to prompt the user which jars to be loaded, while building (I suggest this option, rather than loading all the jar's of project A and project B).

  • How to add jar files which point to project

    when i create project in jse8 i added jar files form system.
    then when i move that project to another system it is asking for jar files.it is pointing to location from where we added.
    how to make jar files available locally so that i can move anywhere.

    This might be a CRUDE solution, but it helps :-)
    1. Create a new folder (e.g. lib) under your project
    2. Copy the interested Jars to the folder. ( I am not sure how to do from within the IDE, I just copied the jars using Explorer.
    3. Right-Click on the Libraries Node to add the Jars and Add them from the folder created in step 1.
    This works... :-)

  • Adding patch jar file while starting Managed Server through Node Manager

    Hi,
    I am using Weblogic Express 10.0 on Linux env, Jrockit JVM.
    I have a patch jar file from BEA, I added it to Weblogic start script, when I start the Managed server by using startManagedWeblogic.sh script, I can see that patch jar file is added to classpath when I grep for Java process.(ps -ef | grep -i java).
    But when I start the Managed server through NodeManager and grep for java process, I dont see the patch jar file added to classpath of Managed server process which is started.
    Can someone let me know if I have to add the patch jar file somewhere else along with Weblogic start script if starting Managed server through Node Manager?
    Weblogic Consultant

    Thanks for your response.
    I found another way to do this.
    Edit nodemanager.properties file and set StartScriptEnabled=true (By default it is false), and then restart the Node Manager process.
    Enabling this setting to true will enable the NodeManager process to use startManagedWeblogic.sh script while starting the managed server, all the added jar files, memory settings will be taken from start script of Weblogic
    Weblogic Consultant

  • Program run in Netbeans but NOT running as jar file

    Dear all ,
    i hope any help in this problem.
    i am writing program to access parallel port i put next files :
    1. [ comm.jar + javax.comm.properties ] in
    [ C:\Program Files\Java\jdk1.6.0_18\lib ] and [ C:\Program Files\Java\jdk1.6.0_18\jre\lib ]
    2. [ win32com.dll ] in [ C:\WINDOWS\system32 ]
    when i run application in NetBeans IDE 6.8 work fine and every think is ok
    BUT when i produce jar file , generated jar file does not work [GUI appear but can not get ports on PC]
    - I try to set Environment Variable as next :
    CLASSPATH = .;C:\Program Files\Java\jdk1.6.0_18\lib\comm.jar
    also does not work
    any tip please ?
    Thanks in advance
    Nabil

    First of all, leave the lib and jre/lib directories of the JRE alone. Never ever touch them again. Remove any jars you have put there yourself, or better yet completely remove and reinstall the JRE to make sure you put it back in a correct state.
    After you do that, learn how to properly work with the classpath in both the IDE and the command line.
    Netbeans: you define the classpath by adding jars to the project (right click on the libraries node in the project tree to get the appropriate options).
    Command line: this depends on if you run a single class, or you invoke an executable jar.
    Single class: you use the -cp command line switch to define the classpath
    Executable jar: the jar itself defines the classpath in its META-INF/manifest.mf file. The -cp command line switch is ignored.
    Since you use Netbeans, you'll get an executable jar so make sure to learn how such a jar is structured.

  • JDBC driver is not working in JAR file

    Hello
    Java is new for me.
    In my project JDBC is working fine for MSSQL Server 2000. It is developed in Netbeans.
    Now When I am going to rin JAR file of project, Driver for MSSQL is not found.
    Can anyone tell me that What I have to do to work with MSSQL driver in JAR file of project?
    I am using "Microsoft SQL Server 2000 Driver for JDBC" for JDBC.

    In my project JDBC is working fine for MSSQL Server
    2000. It is developed in Netbeans.
    Now When I am going to rin JAR file of project,
    Driver for MSSQL is not found.
    Can anyone tell me that What I have to do to work
    with MSSQL driver in JAR file of project?
    I am using "Microsoft SQL Server 2000 Driver for
    JDBC" for JDBC.Adding the JAR to the Netbeans project means adding it to the classpath for the IDE only, the JAR which you developed still needs the driver jar in the classpath.

  • How to call  a jar file for the dynamic menu

    hi ,
    I am using JDEV 11.1.2.2.0 version.
    My problem is this,
    when dynamic tree populate using java bean class(data come from the table)
    how can we call a jar files(seperate projects jars) to each link of the tree.
    plz help...
    -Harsh-

    Hi,
    projects are a design time functionality. So what is the use case? I it is a Java object stored in the JAR file then you would configure this JAR file in the ViewController project library section (project properties)
    Frank

Maybe you are looking for

  • Right way to delete row before insert

    I create a new row with method of ViewObject. Row row = viewObject.createRow();Then I want to delete this row. I found there are 4 methods. Which is the right answer? //1. row.remove(); //2. row.refresh(Row.REFRESH_REMOVE_NEW_ROWS); //3. row.refresh(

  • Lightbox won't work - opens in a new page or not at all

    Okay, so I am trying to get a lightbox to work for my ICT coursework (for an eportfolio) that is due in on the 26th April 2013. I have spent hours on this and have gotten nowhere and now I've resorted to asking you bright people to help ;_; So I foun

  • Multiple Google calenders in iCal and on iPhone

    I have a google calender account. I use the CalDAV to sync it with iCal. However, in google calenders you can create multiple calenders (for instance, one for work, one for home. Every calender with a different color). I can't seem to sync both calen

  • A corrupted CoreStorage volume... what to do next?

    Hi all, I got my new computer (MacBook Pro 13-inch Early-2011 purchased from the Apple Online Store) with Lion installed. One of the best features in Lion is the revamped FileVault which uses CoreStorage to encrypt the whole disk. Everything was fine

  • My apple id will sign in on computer but not in facetime or imessage

    i can log onto apple id website with password etc when i go to ipad and log on with same email and password, the ipad will not accept the password and email with facetime and imessage... i don't get it.