Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java compilation taking long time with java 6 after upgrading OS X with java 7

 
Nitesh Patel
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Recently my macbook was crash and our support team had reformat and update it. While this, they had updated java 7 but as my current project required java 6, I tried to set JAVA_HOME pointing to java 6 jdk and try to compile my source code. But it seems that it taking ages to compile with java6. When I investigate and try to compile one 1 java file, it takes 1 minutes 20 seconds. Surprisingly, but if I do it using sudo then it run instantly(same like java7),


I have verified the file permission and its as expected,


This is my java version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)


Can someone please help me ?

regards,
Nitesh
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try a reboot ?

Tasks taking a long time to run , especially when nested , is a characteristic of OS X.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roger Sterling wrote:Tasks taking a long time to run , especially when nested , is a characteristic of OS X.

While I'm not sure what you mean by "nested" in this context, I can't corroborate any general slowness of OS X with respect to development tasks (or any others, for that matter), nor am I aware of such claims by others - so calling it a "characteristic" seems off the mark. Nitesh's experience before the upgrade (or using sudo now) would seem to bear that out.
 
Nitesh Patel
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I already try to reboot and repair disk permission but no luck. I also tried to set to jdk1.6 but still no luck. If I use sudo then it executes normally (instantly). Is there any way I can find out root cause ?

Kind regards,
Nitesh
 
Roger Sterling
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:
Roger Sterling wrote:Tasks taking a long time to run , especially when nested , is a characteristic of OS X.

While I'm not sure what you mean by "nested" in this context, I can't corroborate any general slowness of OS X with respect to development tasks (or any others, for that matter), nor am I aware of such claims by others - so calling it a "characteristic" seems off the mark. Nitesh's experience before the upgrade (or using sudo now) would seem to bear that out.


Well ok, maybe 'characteristic' is an overstatement.

http://osxdaily.com/2012/10/11/mac-running-slow-reasons/

I run three OS at home : OS X on a two year old iMac , Windows 8.1 on a 6 month old laptop (Asus G75) , and Fedora 19 on a six month old Intel nuc media server with Diskstation. OS X sometimes does incur responsiveness issues due to the need to be rebooted. I often have several browser sessions, Mail , iTunes, and several other applications running which is partly my fault.

Nested refers to any time you invoke a virtual environment :

http://download.parallels.com/desktop/v9/ga/docs/en_US/Parallels%20Desktop%20User's%20Guide/33236.htm

If the developer is writing an Android app, the Android environment is nested within the OS X environment, which can impact performance significantly.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11865
194
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Nitesh, I haven't seen that.

Roger Sterling wrote:[in my experience] OS X sometimes does incur responsiveness issues due to the need to be rebooted.

In my experience, the opposite is true. At work I run OS X with Firefox (multiple tabs), Outlook, IntelliJ and iTerm2 open pretty much 24x7. I then run other applications as needed - so Word, Excel, SQL Developer, Power Point, ADT, Oracle DB, Radium, etc. may all be running at different times. Just not all of them are running simultaneously. I'd say I reboot maybe once every 6 months or so. I restart individual applications as needed - if Outlook becomes less responsive than I'd like, then I restart just that one application.

Back when I used to run Linux as my workstation at work, I'd reboot about every 6 months. I just checked my Linux server at home - it currently has an uptime of 106 days (this was the last power outage we had here).

It has been over a decade since I was forced to use Microsoft Windows as a workstation. Back then I would shut down every night. I would be surprised if that was still needed now though - improvements in both the OS and the power consumption of current Windows machines should have alleviated that necessity.

Having said that, though, I do have a Microsoft Windows machine here that I use for gaming. At night it also runs as a Jenkins slave to compile JForum (the software that runs these forums) so that I can ensure that there are no OS-specific code. Compile times on my Mac, my Linux server, and the Microsoft Windows computer (all similar hardware, just different operating systems) are very similar.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I reboot my Windows machine once a week (because we are asked to shut it down over the weekend). I've had a few problems, but most weeks it makes it through the week just fine. I do log off every night though so Firefox isn't just accumulating memory for a week
 
Nitesh Patel
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Thanks for your reply. I also understand most of time reboot solve problem when we have slow responsive application. But in this case situation is different as I had rebooted it couple of times, try to repair disk permission (n rebooted) but no. There is also no indexing (spotlight) problem. When I tried to compile 1 java file with settings JAVA_HOME to jdk1.6 (which is under /System/Library...) it taking 1 minutes 20 seconds but if I run same javac command with sudo then it run instantly. Also, if I don't set JAVA_HOME and use default (which is jdk1.7 under /Library/Java/) run instantly.

Is there any way I can find it out why it taking long time with jdk1.6 ?

Kind regards,
Nitesh
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Run a fine-grained disk test.

The Java compiler is very fast and regardless of which version you're running, can compile hundreds of classes in a few seconds on virtually any platform.

But if your disk drive is failing and having to constantly retry read/write operations, the the process is going to be greatly impeded.

Case in point:

My wife bought a new laptop several years ago and booting it up was agony. It would take up to 20 minutes to get functional. It spent a lot of time scanning and fixing files.

Finally I got fed up, inserted one of my Linux live boot discs into the machine and booted that (it was a Windows machine and I needed the Linux disk utilities).

The badblks utility indicated that the hard drive was a mess of unrepairable bad sectors. I got on eBay, bought a new-in-bag exact replacement (same brand, same model) and just for giggles ran a scan on it before attempting to replicate the data from the old disk.

Darned if the new disk didn't have twice as many defects as the original. Had to persuade the seller that the unit was faulty, but he made good and the new unit was good. The data part of the old disk was pretty much burnt toast, but fortunately the recovery partition was all clean, so after replicating the disk image, I booted the new drive and ran the Windows re-install to recover. We've had good performance on the unit ever since.

So run a low-level disk scan and just to be safe, a set of RAM tests as well. If that doesn't turn up anything, delete the offending JDK and re-install it.

Incidentally, JAVA_HOME is a convention used by many Java apps, such as Tomcat, but it isn't used in any way by the Java compilers.

There's something missing in what you're telling us, though, if the same command-line command runs noticeably slower native than it does under sudo. I can't remember if the defaults under sudo include pulling in environmental info from the root account or not, but you might want to check those options as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic