Results 1 to 19 of 19
  1. #1
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Exclamation How to use comm.jar and win32com.dll anywhere

    i wanna code a program that read and write from and to a COM port and wanna this program works anywhere anybody can help me?
    Thanx!

  2. #2
    siva_vs_siva is offline Member
    Join Date
    Aug 2010
    Posts
    31
    Rep Power
    0

    Default

    softwares to work with COM

    1 comm.jar
    2 win32com.dll
    3 javax.comm.properties.

    comm.jar should be placed in:


    %JAVA_HOME%/lib
    %JAVA_HOME%/jre/lib/ext

    win32com.dll should be placed in:

    %JAVA_HOME%/bin
    %JAVA_HOME%/jre/bin
    %windir%System32

    javax.comm.properties should be placed in:


    %JAVA_HOME%/lib
    %JAVA_HOME%/jre/lib

  3. #3
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default RE

    i know that but i wanna code a portable application
    my main problem is win32com.dll
    u suggest me that my application automatically place win32comm.dll in java-home/jre/bin ?

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    i know that but i wanna code a portable application
    my main problem is win32com.dll
    u suggest me that my application automatically place win32comm.dll in java-home/jre/bin ?
    Nope, you have to do that yourself (one way or the other).

    kind regards,

    Jos

  5. #5
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    my application is like this :
    http://milimilimilson.persiangig.com/Hiisi1.6.3.zip
    (please download and open Pihatonttu.cmd in notepad)
    but i cant find out how this application use its win32com.dll
    this application do not place win32com.dll in any folder and use it itself(whitout copying win32com.dll to another directory ! )
    *********************************************
    and please anyone tell me what

    "javaw -Djava.library.path=. -cp .\lib\comm.jar;.\lib\jdic.jar;.\class Pihatonttu.PihatonttuMain COM3 null"

    means exactly!
    Thanx!
    Last edited by m-i-l-s-o-n; 09-04-2010 at 11:36 AM.

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    and please anyone tell me what

    "javaw -Djava.library.path=. -cp .\lib\comm.jar;.\lib\jdic.jar;.\class Pihatonttu.PihatonttuMain COM3 null"

    means exactly!
    Thanx!
    Type in the following:

    Java Code:
    java -help
    and see the meaning of those flags (don't type 'javaw' because that version of the jvm doesn't have a console so it can't print anything).

    kind regards,

    Jos

  7. #7
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    josAH did u download hiisi program from my previous post?
    if no please download that and open Pihatonttu.cmd with notepad and tell me how this application use win32com.dll without copying it to any directory
    i think it change java.library.path value but i dont to where : - )
    can you help me?

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    josAH did u download hiisi program from my previous post?
    if no please download that and open Pihatonttu.cmd with notepad and tell me how this application use win32com.dll without copying it to any directory
    i think it change java.library.path value but i dont to where : - )
    can you help me?
    I don't haver Notepad on this machine; aamof I don't even run a version of MS Windows on this machine (it's a Linux box) so there is no use downloading and installing the stuff, but if some software wants to install itself it has to install all its necessary components itself; nothing happens automagically. I suggest you'd have a look at IzPack (google for it); it is a simple and adequate installer.

    kind regards,

    Jos

  9. #9
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    dear josAH my main problem have solved now but i have a question from u
    tell me whats the diffrence between "java.library.path" and "classpath"
    and tell me when i use for example java.awt.* or javax.comm or ... which directory in my pc be scanned to find these packages java.library.path or classpath or ?
    Thanx a lot!

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    dear josAH my main problem have solved now but i have a question from u
    tell me whats the diffrence between "java.library.path" and "classpath"
    and tell me when i use for example java.awt.* or javax.comm or ... which directory in my pc be scanned to find these packages java.library.path or classpath or ?
    Thanx a lot!
    The java.library.path property points to the directory where the native code libraries are stored; the classpath variable is a list of directories (and jar files) where the compiled java classes are stored (the .class and .jar files).

    kind regards,

    Jos

  11. #11
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    last question : when i write "import java.awt.*" or "import javax.comm"
    which directory in my pc be scanned for these packages?

  12. #12
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,329
    Rep Power
    25

    Default

    which directory in my pc be scanned for these packages?
    As JosAH said:
    the classpath variable is a list of directories (and jar files) where the compiled java classes are stored (the .class and .jar files).

    This is where the javac program will search for packages and classes.

  13. #13
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    no i mean when i write "import java.awt" which directory be scanned for AWT package or when I write "import javax.comm" which directory be scanned for comm package can anyone help me?

  14. #14
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by m-i-l-s-o-n View Post
    no i mean when i write "import java.awt" which directory be scanned for AWT package or when I write "import javax.comm" which directory be scanned for comm package can anyone help me?
    Suppose your classpath variable contains a directory 'X' (whatever that may be); the directories X/java/awt and/or X/javax/com are scanned for files in those packages. If otoh, your classpath contains a .jar file 'Y.jar' then that file is scanned for entries java/awt or javax/com respectively.

    kind regards,

    Jos

  15. #15
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    Suppose your classpath variable contains a directory 'X' (whatever that may be); the directories X/java/awt and/or X/javax/com are scanned for files in those packages. If otoh, your classpath contains a .jar file 'Y.jar' then that file is scanned for entries java/awt or javax/com respectively.
    but there is not java/awt directory in X ( i dont understand )

  16. #16
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,329
    Rep Power
    25

    Default

    there is not java/awt directory in X
    Then javac won't look there for the java.awt package.

    The javac program scans the folders and jar files in the order they are in the classpath.
    It's first found, first used.

  17. #17
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

    Default

    Then javac won't look there for the java.awt package.

    The javac program scans the folders and jar files in the order they are in the classpath.
    It's first found, first used.
    if there is not java.awt package in the X directory from where javac starts scanning ?

  18. #18
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,329
    Rep Power
    25

    Default

    from where javac starts scanning
    It scans the paths that are on the classpath.

    It has a jar file for its own JDK classes. After that it looks on the classpath

    Do you understand the idea of a path variable and how a program uses its contents?

  19. #19
    m-i-l-s-o-n is offline Member
    Join Date
    Sep 2010
    Posts
    24
    Rep Power
    0

Similar Threads

  1. comm package api
    By leslie samuel in forum New To Java
    Replies: 5
    Last Post: 08-30-2010, 06:30 AM
  2. Replies: 7
    Last Post: 07-12-2010, 04:24 PM
  3. Web application hang without comm.jar
    By chankokchern in forum Java Applets
    Replies: 0
    Last Post: 12-16-2008, 12:38 PM
  4. HL7 Comm 0.8.5
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 07-23-2008, 02:07 PM
  5. Comm API Usage
    By hobbyist in forum New To Java
    Replies: 0
    Last Post: 11-16-2007, 04:59 PM

Posting Permissions

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