Results 1 to 3 of 3
Thread: Help with a Jar File
- 11-20-2010, 04:30 AM #1
Member
- Join Date
- Nov 2010
- Posts
- 1
- Rep Power
- 0
Help with a Jar File
Hey Everyone,
I found an opensource Java project which calculates solunar table/times. I found it here: SourceForge.net: Java Solunar Lib - Project Web Hosting - Open Source Software
I have downloaded the jar file and looked at the source code. I am fairly new to Java. I took 2 or 3 java classes when I was in college but that has been about 10 years ago. I remember the very basics but that is about it.
I want to create a basic command line program that will ask the user for the year, month, date, latitude, and longitude and then use this jar file to calculate the solunar times.
I am comfortable with creating a basic java program and prompting the user for year, month, date, latitude, and longitude and storing the input in variables.
However, what I am not sure about is:
1)How do I import/include this jar file into my program so I can use its classes?
2)How do I actually call the jar file and pass the variables to it and receive its output?
Any help would be greatly appreciated because there is virtually no documentation that goes along with the jar file.
Thanks!
Jeremy
- 11-20-2010, 04:54 AM #2
You include the jar file on your compile time and run time classpath.1)How do I import/include this jar file into my program so I can use its classes?
You don't call a jar file. You use the classes in the jar and call their constructors/methods/fields.2)How do I actually call the jar file and pass the variables to it and receive its output?
Search the net for Java Classpath for more information on how to use it with the command line -cp flag and from a jar manifest.
db
- 01-07-2011, 09:19 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 1
- Rep Power
- 0
Solunar.jar - not so user friendly
I too downloaded solunar.jar and got nowhere. No documentation and no idea how it should work.
Then from sourcforge I got the whole sources tarball
In the package is a "Test.java" file.
I copied Test.java to../javasolunarlib/branches/javasolunarlib1.01/src/
Then using the wonderful tool Drjava (also from sourceforge) I compiled Test.java and all the other .java bits in:
../javasolunarlib/branches/javasolunarlib1.01/src/org/redout/solunarlib/
such as :
AstroWorkflow.java
and the rest.
Looking at the source code of Test.java the date and latitude and longitude are already hard coded. (Date 2010, 10, 4)
I got it to run, added some notes myself as to what is what "i.e. "sunrise" "major times" etc. and had a simple solunar tables program- albeit ugly.
I can't program Java yet so making it user friendly is the job of someone with more experience. At least that code doing all the work is there and works somehow.
I think jkruer01 you could build on Test.jar using basic Java knowledge and have something that does the job. If you do share it please!
Example of the output with my notes added in:
2010 10 4
2455473.5
0.041666666666666664
55472.958333333336
Sunrise
13:19
Sunset
0:58
Sun-transit
19:08
moonrise
9:28
moonset
22:57
moontransit
16:19
moon under foot
3:11
moonphase
Waning Crescent
moon illumination
15.675909994254638
phase age
24.10401954195298
minors
8:28 - 10:28
minors
21:57 - 23:57
majors start end
14:49 - 17:49
majors start end
1:41 - 4:41
day scale
0Last edited by paulski; 01-07-2011 at 09:22 PM.
Similar Threads
-
pack200 .gz file unpack and create .jar file in browser(speed test).
By maheshsardar in forum Java AppletsReplies: 1Last Post: 08-04-2010, 03:24 PM -
Log4J : logs of a specific category to a file, but only errors to the file AND stdout
By msegmx in forum Advanced JavaReplies: 0Last Post: 07-15-2010, 01:23 PM -
Sending a File from Server to Client and saving the file to Clients computer
By al_Marshy_1981 in forum NetworkingReplies: 8Last Post: 02-18-2010, 12:54 PM -
how to read openproj(Projity) file i.e. ,POD file(Project Management file)
By mahendra.athneria in forum New To JavaReplies: 0Last Post: 02-11-2009, 09:53 AM -
How to parse the CSV(Comma separation values)file and validate the file using java
By padmajap13 in forum Advanced JavaReplies: 7Last Post: 05-23-2008, 03:46 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks