|
-
March 22nd, 2005, 08:40 AM
#1
Running program with Javax.comm jar and manifest
Hi,
I put my program in a Jar file.
with a bat file I can make it run with the jar file for the serial communication.
(java -cp comm.jar;MyProgram.jar MyProgram)
but with a manifest file I have no clue.
It runs when I double click on it but no serial communication.
Should I insert the Jar of the Javax.comm in the jar file?
and how do I tell the program that it is there?
And the Dll(win32com.dll) I need for the communication, does it need to be included in the jar file? or is next to the Jar file enought? and what about javax.comm.properties?
Thx,
Jewe
A VB programmer trying to stay alive in a Real C World
 If the hardware is so great.. why use software to correct it..?? It will only slow it down..
 Al is de hardware nog zo snel de software achterhaalt het wel 
-
March 22nd, 2005, 10:38 AM
#2
Re: Running program with Javax.comm jar and manifest
Hi,
Have you tried the
attribute, use it like you would use the
attribute.
Byron
-
March 22nd, 2005, 10:48 AM
#3
Re: Running program with Javax.comm jar and manifest
If you specify the Main-Path and Class-Path options in the manifest file, you should be able to run your application by executing
Code:
java -jar MyJar.jar
You can put the proprties file in your jar and load it from the class path if you are not going to make any changes to it (it can't easily be changed inside a JAR file).
The other jar files you use and any external DLLs you use should not go in your jar file.
Have a look here:
http://java.sun.com/docs/books/tutor...t/downman.html
-
March 24th, 2005, 06:15 AM
#4
Re: Running program with Javax.comm jar and manifest
 Originally Posted by Davey
You can put the proprties file in your jar and load it from the class path if you are not going to make any changes to it (it can't easily be changed inside a JAR file).
Ok, it runs but is still unable to find the property file.
Just to be sure I understand what you are saying.
I should also insert javax.comm.properties also in the manifest file?
like:
Code:
Class-Path : Javax.comm;javax.comm.properties
at the moment I only have
Code:
Class-Path : Javax.comm
Main-Class: MyApplication
Thx,
Jewe
A VB programmer trying to stay alive in a Real C World
 If the hardware is so great.. why use software to correct it..?? It will only slow it down..
 Al is de hardware nog zo snel de software achterhaalt het wel 
-
March 25th, 2005, 01:09 PM
#5
Re: Running program with Javax.comm jar and manifest
You don't need to reference the properties file in the manifest, you simply put it in the jar file.
Have a read of the following for details of how to load properties files from within your class path.
http://www.javaworld.com/javaworld/j...-property.html
-
March 26th, 2005, 05:14 AM
#6
Re: Running program with Javax.comm jar and manifest
there is no Main-Path element in a manifest. I think Davey meant to say Main-Class
the Class-Path element of a jar file is a SPACE SEPARATED list of jar files that this jar file will use
you cannot package another jar file inside your application's jar file; the classloader is too retarded to be able to extract it, sorry
Main-Class: com.my.MainThing
Class-Path: javacomm.jar someother.jar jaf.jar javamail.jar
these jars must be accessible either in the same dir as your app jar, or in the lib/ext dir of the JRE that will run your app, or in one of the dirs specified on the CLASSPATH variable of the system
the class-path element in the manifest is not well named. it does not specify any paths, it may be better named (and thought of) as:
List-Of-Classes-And-Jars-My-App-Will-Use: A.class b.jar
these classes and jars must still be found by the classloader using the conventional methods (lib ext, current dir, classpath env var)
-
March 27th, 2005, 12:24 PM
#7
Re: Running program with Javax.comm jar and manifest
 Originally Posted by cjard
there is no Main-Path element in a manifest. I think Davey meant to say Main-Class
Thats what I was thinking in my head .
Sorry for any confusion.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|