[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 428
  • Last Modified:

jfreegraph--loading time- URGENT

Hi,

I am using jcommon-1.00.jar for jfreegraph...however, i am not using everything...

Because the jar file is large,it takes a very long time to load...

how to unjar so that i choose another class i use and then jar it back..plshelp..

pls let me know if i explain not so ok..
0
Jasbir21
Asked:
Jasbir21
  • 11
  • 7
  • 5
  • +3
4 Solutions
 
CEHJCommented:
>>how to unjar so that i choose another class i use and then jar it back..plshelp..

That's a dangerous strategy, as you could easily omit necessary classes. It could even violate the licence
0
 
StillUnAwareCommented:
Actually, JVM loads only those classes it needs to, so all You could do is to jar it without compression. This should speed it up a lot.
0
 
Jasbir21Author Commented:
but i read somewhere that because too big, you could use only wanted classes..
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Jasbir21Author Commented:
--->>>
Actually, JVM loads only those classes it needs to, so all You could do is to jar it without compression. This should speed it up a lot.

how to jar without compression then...
0
 
CEHJCommented:
(I'm assuming you're talking about 'loading' as in downloading the jar across a network *then* loading)

Please clarify if that's not the case
0
 
Jasbir21Author Commented:
actually, what i mean is that when i download across network , it takes very long time...

However, if the file is on my pc, it takes very fast...

I am trying to decrease download time...

sorry..i use wrong word...
0
 
Jasbir21Author Commented:
not to sure whether the word is load or download then....
0
 
sciuriwareCommented:
Then the network is the bottleneck and uncompression makes things only worse!

;JOOP!
0
 
CEHJCommented:
>>That's a dangerous strategy,

But if you want to give it a try, start the app with the verbose flag set, then you can see what's being loaded
0
 
Jasbir21Author Commented:
>>That's a dangerous strategy,
meaning is that against license agreement...?
0
 
CEHJCommented:
java -verbose YourApp | find "freegraph" >>fgloading.log

The last named file will contain freegraph (if that's a valid part of a package) classes loaded
0
 
Jasbir21Author Commented:
It is just that, when it is on pc, the time is faster because it is nearer ...

but when on the server, to download to web it takes very long time....even though it says

 "Applet " loaded and after some time, you would see "Applet started", you still need to wait before all the download complete....
0
 
gauravkrtomarCommented:
http://www.esus.com/javaindex/j2se/javawebstart/wseagerlazy.html

there is something as lazy download and eager download......the above code shows that for Java Web Start. But if you are using Applets then i dont think you have any other option, u have to face the sloppyness of loading all the jars.
0
 
Jasbir21Author Commented:
actually, this is applet....
0
 
Jasbir21Author Commented:
but if i unjar the file, and use only needed classes, i am violating the license...?
0
 
Jasbir21Author Commented:
and i put a copy of the jar file (everything on the server) as well...
0
 
CEHJCommented:
>>actually, this is applet....

In that casel, what you're witnessing is probably partly due to the loading of the VM
0
 
gauravkrtomarCommented:
One thing you can do is that the JFreeChart is open source and the code for the same is also available.

So just download the source files, and see wat all the classes you need to run your program.
Then make a jar containing only the necessary classes.

This way you will not be violating any license agreement, plus there might be case that the jar is signed(thus you will not have control over the jfreechart.jar) then by creating ur on jar u can have full control.
0
 
CEHJCommented:
>>i am violating the license...?

Check the terms
0
 
Jasbir21Author Commented:
--->>see wat all the classes you need to run your program. Then make a jar containing only the necessary classes.

ok..i think i understand now...lets say i put the classes file in the folder called org..how do i jar the folder then...is it by using winzip ?


0
 
gauravkrtomarCommented:
u can use the jar utility provided by the Sun

jar -cf abc.jar org

where abc is the name of the jar and org is the directory


0
 
gauravkrtomarCommented:
try using that command at the command prompt........
also u can view the help by using following command at command prompt:-
jar -help
0
 
sciuriwareCommented:
Jasbir21, I get the impression that you don't know the jar command etc.

Please stop what you're doing: you'll leave classes out that are occasionally needed
and you'll end up with a failing package.
Better a slow load than nothing at all.

;JOOP!
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> So just download the source files, and see wat all the classes you need to run your program

BTW, the classes being used might also internally use some other classes which you might miss out, so its better not to do that.
0
 
Jasbir21Author Commented:
pls give me some time to read this....
0
 
gauravkrtomarCommented:
>> So just download the source files, and see wat all the classes you need to run your program
If u have the source-code u can't compile the classes if the necessary classes r not available.
0
 
CEHJCommented:
:-)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 11
  • 7
  • 5
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now