-3

Hello fellow developers!

I have written a Java program that uses an earlier version of JFreeChart (coincidentally, I found it already on my computer whilst downloading the Android SDK) to create some charts. What I am wondering is two things (yes, this is a double question):

1.) Will this program work on other computers that may (or may not) have a version of JFreeChart installed (or any at all). I think I might know the answer to this: a JAR file is a compressed version of the bytecode that the Java code is compiled to.

2.) I have been having problems with this program; I have used a Time object for the times elapsed (this is the range axis), and it treats the Time like a time of day! I was thinking about getting the user's time zone, and then truncating the long number that is the time elapsed to remedy this, but is that the only way?

Mike Warren
  • 3,796
  • 5
  • 47
  • 99
  • You're (two) questions are significantly different and should be posted separately. As it stands you current post is very localized. – Perception Apr 21 '13 at 07:34

1 Answers1

2

Will this program work on other computers that may (or may not) have a version of JFreeChart installed (or any at all).

No. Java programs need to ship their dependencies (except for the JVM itself and its libraries) with them. You can bundle them all together in one executable jar file.

Thilo
  • 257,207
  • 101
  • 511
  • 656
  • The second question was resolved. I guess the update I installed yesterday caused `System.currentTimeMillis()` to return the time in the timezone of your computer! As for the first question, if you are using Eclipse and have those libraries already brought into the project (which is a must if you need those non-JRE libraries!!), does Eclipse ship a copy of those libraries with the program itself automatically? `//I am using Eclipse Juno.` – Mike Warren Apr 21 '13 at 09:05