How can I use this JAR file?
Hello everybody, I am new here and new to Java, so please be patient if you can. I am trying to make a java project that will make use of a JAR file. The JAR file is called javaanpr.jar and is available in this package
JavaANPR - Automatic number plate recognition system
What I want to do should be pretty simple, I write my own java program that will send a jpeg to that JAR and get the result from it.
Sadly, as I am a PHP coder, I do not have much java experience.
From what I have seen on example programs, I need to reference the JAR in my build path and import the JAR, I have done both of these.
I am now lost, so maybe somebody can give me some pointers?
Thanks in advance
Re: How can I use this JAR file?
There is some confusion here on what a jar file is. It is like a zip file, it contains compressed files like images and class files. The java program can start the execution of one of the class files if there is a manifest file with a Main-Class entry that gives the name of the class to start execution.
When you say you want to "send" an image file to the jar file, what does that mean?
You can write a program that uses the classes contained in the jar file. If you add the jar file to the compiler's classpath and to the java program's classpath you can use classes from the jar file.
Are you trying to write a java program that calls methods in the classes in the jar file?
If you put the jar file on the classpath you will be able to do that.
Re: How can I use this JAR file?
Quote:
Originally Posted by
Norm
There is some confusion here on what a jar file is. It is like a zip file, it contains compressed files like images and class files. The java program can start the execution of one of the class files if there is a manifest file with a Main-Class entry that gives the name of the class to start execution.
When you say you want to "send" an image file to the jar file, what does that mean?
You can write a program that uses the classes contained in the jar file. If you add the jar file to the compiler's classpath and to the java program's classpath you can use classes from the jar file.
Are you trying to write a java program that calls methods in the classes in the jar file?
If you put the jar file on the classpath you will be able to do that.
Hi Norm, thanks for your reply. Yes, I want to make a program that calls methods in the jar file.
I have put the jar in my class path, but I need some help/tips on how I can now use it ( I am new to java so am a little lost )
Re: How can I use this JAR file?
Quote:
how I can now use it
You will have to ask the author(s) of the programs that are in the jar file. There should be some API doc available for how other programmers can use the classes in the jar file.
Re: How can I use this JAR file?
Re: How can I use this JAR file?
Quote:
Originally Posted by
Norm
You will have to ask the author(s) of the programs that are in the jar file. There should be some API doc available for how other programmers can use the classes in the jar file.
I dont think there is any API documentation available. This means there is no way for me to use it?
Re: How can I use this JAR file?
Quote:
This means there is no way for me to use it?
Just about. The author would have published doc for the classes if (s)he had intended them to be usable outside of this jar file. Have you looked in the jar file to see if there is source or doc in there?
You can use a zip file utility to see the contents of the jar file.
Re: How can I use this JAR file?
Quote:
Originally Posted by
Norm
Just about. The author would have published doc for the classes if (s)he had intended them to be usable outside of this jar file. Have you looked in the jar file to see if there is source or doc in there?
You can use a zip file utility to see the contents of the jar file.
I have all the source code of the JAR file, I guess it is best to read this source and try and figure out how it works?
Re: How can I use this JAR file?
Quote:
Originally Posted by
IrishGirl
I have all the source code of the JAR file, I guess it is best to read this source and try and figure out how it works?
Yes, that would be the way.
There is a program that may be useful: javadoc will read the .java files and produce an outline of the classes and their methods and include some doc if the authors followed the recommended commenting.