Java is extremely slow to start up

7,037

Solution 1

This is probably due to a not-so-well-known bug #6999460:

I hit the same bug yesterday and just couldn't believe it.

In my case, compiling 18 short *.java files with javac took more than 3 minutes (on a Core i5 with everything on a SSD).

Try the same with Java 7 update 51.

Solution 2

Try java -verbose, it will print each step that it goes through, maybe you'll notice which steps take a long time.

I tried java -verbose -version and what it does is load a bunch of jars from disk. Maybe your harddrive needs some love?

Share:
7,037

Related videos on Youtube

Jason Dahl
Author by

Jason Dahl

Updated on September 18, 2022

Comments

  • Jason Dahl
    Jason Dahl over 1 year

    I have a strange problem where it takes about 8 minutes (not an exaggeration) to start up java. This includes calling java or javac from the command line, or starting any java application, most notably eclipse. This problem is only on my windows 7 boot though, and my Ubuntu boot doesn't slow down at all. Any ideas why this is so slow? Here is any info that might be relevant.

    Microsoft Windows [Version 6.1.7600]
    
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    c:\Users\Jason>java -version <-- this command took about 5 minutes to do
    
    java version "1.7.0_02"
    
    Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
    
    Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)
    
    • Thorbjørn Ravn Andersen
      Thorbjørn Ravn Andersen over 11 years
      Anti-virus. Broken dns. Disk about to die. System badly swapping.
    • Tom Hawtin - tackline
      Tom Hawtin - tackline over 11 years
      (7u2 is a bit out of date.) ctrl-break in its console window may show where the problem is.
    • Ramhound
      Ramhound over 11 years
      Before we help you update your Java installation it very well might be the version you have installed that is the problem. It even seems to me, this version you are on, might be some prelimary release based on the "02b13" version information.
  • Jason Dahl
    Jason Dahl over 11 years
    Well I had this problem for a while, and I even reformatted my laptop and for about a day or two, java was running better, but it didn't take long for it to slow right down again. So I'm not sure if harddrive cleanup could help, but just to clear things up, what should I be looking for with the java -verbose - version command?
  • Mike G
    Mike G over 11 years
    @JasonDahl you'd be looking for the point at which the process slows/hangs/stops.