The Artima Developer Community
Sponsored Link

Java Answers Forum
Problem with Jar

4 replies on 1 page. Most recent reply: Nov 1, 2003 5:14 PM by Senthoorkumaran Punniamoorthy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Problem with Jar Posted: Oct 23, 2003 5:14 AM
Reply to this message Reply
Advertisement
I have written a a program to access Serial Port in Java using the Java Comm API. Everything works fine. But the moment I put the class files inside a Jar file and try to execute it with java -jar option it says

Caught java.lang.ClassNotFoundException: com.sun.comm.Win32Driver while loading
driver com.sun.comm.Win32Driver

I have copied the win32com.dll inside the JDK\bin directory.

Everything works fine until I put the classes into a Jar file. Why it is not working when the classes are indisde the Jar file? How can i make win32com.dll visible to the classes inside the Jar file?


Senthilnathan

Posts: 13
Nickname: ssnathan
Registered: Jul, 2003

Re: Problem with Jar Posted: Oct 30, 2003 4:40 PM
Reply to this message Reply
you have to update ur manifest file to have the required classes in the classpath like,

Class-Path: ./lib/somejar.jar

when you do a java -jar,it normally runs with the classpath mentioned in the manifest file. This has been done for easy packaging.

Joe Parks

Posts: 107
Nickname: joeparks
Registered: Aug, 2003

Re: Problem with Jar Posted: Oct 31, 2003 3:36 AM
Reply to this message Reply
javax.comm is a "standard extension". Did you put the comm.jar (or whatever it's called--I forget) into the JDK/jre/lib/ext directory?

Madhav Bhargava

Posts: 2
Nickname: utopians
Registered: Oct, 2003

Re: Problem with Jar Posted: Oct 31, 2003 1:51 PM
Reply to this message Reply
If u do not want to edit the manifest file directly then u can write a java program using the Mainfest class which will do everything that u desire. This class is present in java.util.jar

Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Re: Problem with Jar Posted: Nov 1, 2003 5:14 PM
Reply to this message Reply
Joe,

Actually the requirement is comm.jar should be put inside the jdk/lib directory. Its in the installation text which comes along with the java comm download.

Thanks Madhav, your post is something interesting that I didn't know. Let me give it a try.

Flat View: This topic has 4 replies on 1 page
Topic: MVC and Struts Previous Topic   Next Topic Topic: Ticker

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use