You are not logged in.

#1 2013-03-24 18:29:04

soulrainX
Member
Registered: 2013-03-20
Posts: 48

Java Applications Launching Slow

So just got eclipse up and running then go do simple test to make sure everything is running smoothly by writing:

import javax.swing.*;
public class SimpleGui1 {
	public static void main (String[] args){
		JFrame frame = new JFrame();
		JButton button = new JButton("click me");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().add(button);
		frame.setSize(300,300);
		frame.setVisible(true);
	}
}

The application window launches and the frame appears but it taks like 10 seconds for the button to appear. Same happens if I compile manually with javac which I guess is to be expected. I have absolutely no idea how to go about solving this or even what to google for a solution. Any help would be greatly appreciated or even just what I should search for would be helpful.

Pretty sure not my rig as is i7 o'c to 3ghz yadda yadda not to mention I dual boot and there isn't this lag on other os's.... must be a tweak somewhere...

Thanks in advance.

Last edited by soulrainX (2013-03-24 18:31:14)


n00b learning linux
arch + lxde

Offline

#2 2013-03-25 08:34:17

wwn
Member
Registered: 2013-03-25
Posts: 70

Re: Java Applications Launching Slow

Hmm,

it's a little bt take a sledgehammer to crack a nut, but you could try to get more information:
VisualVM
JConsole

It could be also worth to have a look here:
Java 2D System Properties

What JDK you are running?

Offline

#3 2013-03-25 12:04:11

soulrainX
Member
Registered: 2013-03-20
Posts: 48

Re: Java Applications Launching Slow

java version "1.7.0_17"
OpenJDK Runtime Environment (IcedTea7 2.3.8) (ArchLinux build 7.u17_2.3.8-1-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

have to check out the links you gave looks like interesting reading either way...Thanks!


n00b learning linux
arch + lxde

Offline

#4 2013-03-25 12:09:39

wwn
Member
Registered: 2013-03-25
Posts: 70

Re: Java Applications Launching Slow

I'll try your tiny panel with a fresh Arch and Oracle JDK 1.7 and report here tonight.

Offline

#5 2013-03-25 20:21:34

wwn
Member
Registered: 2013-03-25
Posts: 70

Re: Java Applications Launching Slow

128 - 152ms with

java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

STS 3.2.0 Juno4.2

I have a T420 with a SSD.

Last edited by wwn (2013-03-25 20:21:46)

Offline

#6 2013-05-04 06:57:43

paulr
Member
Registered: 2007-03-23
Posts: 52

Re: Java Applications Launching Slow

Hi. I had this problem as well.

To fix it you need to add your host name (in /etc/hostname) to /etc/hosts - I added it to the end of each line (not the comment) not sure if that is strictly necessary. The delay is (I think) because Java is trying to resolve your name in /etc/hosts (in my system "ArchBox") and it can't.

Offline

Board footer

Powered by FluxBB