How to get screen resolution (screen size) using Java?

Question:
How to get screen resolution (screen size) using Java?

Code:
import java.awt.*;
 
public class GetScreenSize {
 
  public static void main(String[] args) {
 
    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    System.out.println("Height: " + screen.height);
    System.out.println("Width: " + screen.width);
 
  }
}

Output:
$ java GetScreenSize
Height: 1200
Width: 1920

Counting vowels in a java string?

Question:
How to count vowels in a string?
How to count upper case vowels in a string?
How to count lower case vowels in a string?

Code:
public class CountVowels {
  public static void main(String[] args) {
 
    String str = "abcdefg HIJKLMNOP qrstuvwxyz";
 
    int upper = 0;
    int lower = 0;
    int non = 0;
 
    String vowels = "aeiouAEIOU";
    char[] array = str.toCharArray();
 
    for(char c: array) {
      if(vowels.indexOf(c) != -1){
        if(Character.isLowerCase(c)){
          lower = lower + 1;
        } else if(Character.isUpperCase(c)){
          upper = upper + 1;
        }
      } else {
         non = non + 1;
      }
    }
    System.out.println("String: " + str);
    System.out.println("Upper case vowels: " + upper);
    System.out.println("Lower case vowels: " + lower);
    System.out.println("Non vowels: " + non);
  }
}

Output:
$ java CountVowels
String: abcdefg HIJKLMNOP qrstuvwxyz
Upper case vowels: 2
Lower case vowels: 3
Non vowels: 23

Creating a celsius to fahrenheit calculator using a JSlider.

Question:
Create a celsius to fahrenheit calculator using a JSlider.

Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
 
public class CelsiusToFahrenheit {
 
  public static void main(String[] arguments) {
 
    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame f = new JFrame("Celsius To Fahrenheit");
    f.setSize(400,200);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
    JPanel container = new JPanel();
    container.setBorder(BorderFactory.createEmptyBorder(0,20,0,20));
    container.setLayout(new GridLayout(3, 1));
 
    JPanel results = new JPanel();
    results.setLayout(new FlowLayout());
 
    JLabel cLabel = new JLabel("Celsius: ");
    final JTextField cText = new JTextField(5);
 
    JLabel fLabel = new JLabel("Fahrenheit: ");
    final JTextField fText = new JTextField(5);
    results.add(cLabel);
    results.add(cText);
    results.add(fLabel);
    results.add(fText);
 
 
    JLabel sLabel = new JLabel("Celsius Slider",JLabel.CENTER);
    final JSlider slider = new JSlider(JSlider.HORIZONTAL,0,100,10);
    slider.setMinorTickSpacing(5);  
    slider.setMajorTickSpacing(20);  
    slider.setPaintTicks(true);  
    slider.setPaintLabels(true);  
 
 
    slider.addChangeListener(new ChangeListener() {
      public void stateChanged(ChangeEvent e) {
        int c = slider.getValue();
        fText.setText("" + (c * (double) 9 / 5 + 32) );
        cText.setText("" + c);
      }
    });
 
    // set default value
    fText.setText("" + (slider.getValue() * (double) 9 / 5 + 32) );
    cText.setText("" + slider.getValue());
 
    container.add(sLabel);
    container.add(slider);
    container.add(results);
 
    f.add(container);
    f.setVisible(true);
 
  }
}
 

Output:
 

Drawing a Rectangle using astrisks

Question:
How to write a java program that will ask for the length and width of a rectangle and then multiply them together and create a rectangle out of astrisks?

Code:
import java.util.Scanner;
 
public class Rectangle {
 
  public static void main(String[] args) {
 
    Scanner sc = new Scanner(System.in);
 
    System.out.print("Enter height: ");
    int h = sc.nextInt();
 
    System.out.print("Enter width: ");
    int w = sc.nextInt();
 
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
        System.out.print("*");
      }
      System.out.println();
    }
  }
}

Output:
$ java Rectangle
Enter height: 5
Enter width: 20
********************
********************
********************
********************
********************

m(i)=1/3 + 2/5 +...+ i/(2i+i)

Question:
java program to solve: 

  m(i)=1/3 + 2/5 +...+ i/(2i+i)

Answer:
Use recursion

Code:
import java.util.Scanner;
 
public class Example {
 
   public static void main(String[] args) {
      Scanner input = new Scanner(System.in);
      System.out.print("Enter a value: ");
      int n = input.nextInt();
 
      double d = m(n);
      System.out.println("m(5) = " + d );
   }
 
   public static double m(int i) {
      double d = (double)i/(2*i+1);
      if(i <= 1){
        return(d);
      } else {
        return (d + m(i-1));
      }
   }
}

Output:
$ java Example
Enter a value: 5
m(5) = 2.060894660894661

Create ArrayList (ArrayList) from array (T[])

Question:
I have an array that is initialized like:
  Element[] array = {new Element(1), new Element(2), new Element(3)};

I would like to convert this array into an object of the ArrayList class:
  ArrayList arraylist = ???;

Answer:
new ArrayList(Arrays.asList(array))

Code:
import java.util.*;
 
public class ArrayToArrayList {
 
  public static void main(String[] args) {
 
    String[] array = {new String("aaa"),new String("bbb"),new String("ccc")};
 
    ArrayList<String> list = new ArrayList<String>(Arrays.asList(array));
 
    System.out.println("array: " + Arrays.toString(array));
    System.out.println("list: " + list);
 
  }
}

Output:
$ java ArrayToArrayList
array: [aaa, bbb, ccc]
list: [aaa, bbb, ccc]

How do I convert int[] into List in Java?

Question:
How do I convert int[] into List in Java?

Code:
import java.util.*;
 
public class IntToList {
 
  public static void main(String[] args) {
 
    int[] ints = new int[]{1,2,3,4,5,6,7,8,9};
 
    List<Integer> list = new ArrayList<Integer>();
    for (int n = 0; n < ints.length; n++) {
        list.add(ints[n]);
    }
 
    System.out.println("int[] ints: " + Arrays.toString(ints));
 
 
    System.out.print("List<Integer> list: ");
    for(int i=0;i<list.size();i++){
      System.out.print(list.get(i) + " ");
    }
    System.out.println();
  }
}

Output:
$ java IntToList
int[] ints: [1, 2, 3, 4, 5, 6, 7, 8, 9]
List list: 1 2 3 4 5 6 7 8 9 

How to convert Byte[] to byte[] in java?

Question:
How to convert Byte[] to byte[] in java?

Code:
import java.util.Arrays;
 
public class BytesToBytes {
  public static void main(String[] args) {
 
    Byte[] B = new Byte[]{1,2,3,4,5,6,7,8,9};
    byte[] b = new byte[B.length];
 
    for (int i = 0; i < B.length; i++) {
      b[i] = B[i];
    }
 
    System.out.println("Byte[] B: " + Arrays.toString(B));
    System.out.println("byte[] b: " + Arrays.toString(b));
  }
}

Output:
$ java BytesToBytes
Byte[] B: [1, 2, 3, 4, 5, 6, 7, 8, 9]
byte[] b: [1, 2, 3, 4, 5, 6, 7, 8, 9]

How to convert byte[] to Byte[] in java?

Question:
How to convert byte[] to Byte[] in java?

Code:
import java.util.Arrays;
 
public class BytesToBytes {
  public static void main(String[] args) {
 
    byte[] b = new byte[]{1,2,3,4,5,6,7,8,9};
    Byte[] B = new Byte[b.length];
    for (int i = 0; i < b.length; i++) {
        B[i] = Byte.valueOf(b[i]);
    }
 
    System.out.println("byte[] b: " + Arrays.toString(b));
    System.out.println("Byte[] B: " + Arrays.toString(B));
  }
}

Output:
$ java BytesToBytes
byte[] b: [1, 2, 3, 4, 5, 6, 7, 8, 9]
Byte[] B: [1, 2, 3, 4, 5, 6, 7, 8, 9]

Java program that counts words in a file

Question:
Write a java program that counts words in a file?

Answer:
Here is an example that counts the words in a file called TheCatInTheHat.txt.

Code:
import java.io.*;
import java.util.*;
 
public class WordCount {
  public static void main(String[] args) throws FileNotFoundException {
    Map<String, Integer> map = new HashMap<String, Integer>();
 
    Scanner in = new Scanner(new File("TheCatInTheHat.txt"));
    while (in.hasNext()) {
      String word = in.next();
      word = word.replaceAll("[^a-zA-Z0-9]", "");
      word = word.toLowerCase();
 
      if(map.containsKey(word)) {
        Integer count = (Integer)map.get(word);
        map.put(word, new Integer(count.intValue() + 1));
      } else {
        map.put(word, new Integer(1));
      }
    }
 
    ArrayList arraylist = new ArrayList(map.keySet());
    Collections.sort(arraylist);
 
    for (int i = 0; i < arraylist.size(); i++) {
      String key = (String)arraylist.get(i);
      Integer count = (Integer)map.get(key);
      System.out.println(key + " : " + count);
    }
 
  }
}

Output:
$ java WordCount
a : 33
about : 3
after : 1
all : 15
always : 1
and : 69
another : 2
any : 1
are : 5
as : 9
asked : 1
at : 14
away : 6
back : 2
bad : 2
ball : 5
be : 7
bed : 1
bent : 1
bet : 2
big : 5
bit : 3
bite : 1
.......

Java program to sort a map by value.

Question:
How to sort or order a HashMap or TreeSet or any map item by value?

Answer:
Write a comparator which compares by value, not by key.

Code:
import java.util.*;
import java.util.Map.*;
 
public class SortHashMap {
 
  public static void main(String a[]){
 
    Map<String, Integer> map = new HashMap<String, Integer>();
    map.put("apple", 20);
    map.put("plum", 11);
    map.put("orange", 16);
    map.put("peach", 3);
    map.put("grape", 7);
 
    Set<Entry<String,Integer>> set = map.entrySet();
    List<Entry<String,Integer>> list = new ArrayList<Entry<String,Integer>>(set);
 
    Collections.sort(list, new Comparator<Map.Entry<String,Integer>>() {
      public int compare( Map.Entry<String,Integer> o1, Map.Entry<String,Integer> o2) {
        return (o2.getValue()).compareTo( o1.getValue());
      }
    });
 
    for(Map.Entry<String, Integer> entry:list){
      System.out.println(entry.getValue() + " " + entry.getKey());
    }
  }
}

Output:
$ java SortHashMap
20 apple
16 orange
11 plum
7 grape
3 peach

Test if two numbers have the same digits.

Question:
How to test if two numbers contain the same digits.

Answer:
Convert the numbers to Strings.
Convert the Strings to a Char Arrays.
Sort the Char Arrays.
Compare the Char Arrays.

Code:
import java.util.Arrays;
 
public class Example {
  public static void main(String[] args) {
    System.out.println("12 & 21: " + match(12,21));
    System.out.println("123 & 321: " + match(123,321));
    System.out.println("1231 & 2131: " + match(1231,2131));
    System.out.println("876 & 886: " + match(876,866));
  }
  public static boolean match(int a, int b) {
 
    String s1 = String.valueOf(a);
    char[] c1 = s1.toCharArray();
    Arrays.sort(c1);
 
    String s2 = String.valueOf(b);
    char[] c2 = s2.toCharArray();
    Arrays.sort(c2);
 
    return(Arrays.equals(c1,c2));
  }
}

Output:
$ java Example
12 & 21: true
123 & 321: true
1231 & 2131: true
876 & 886: false

Printing the contents of the manifest file found in a jar?

Question:
How to print the contents of the manifest file found in a jar?

Code:
import java.io.*;
import java.util.*;
import java.util.jar.*;
 
public class PrintManifest {
  public static void main(String[] args) {
    try {
      JarFile jarfile = new JarFile("/jdk1.8.0_40/jre/lib/rt.jar");
      Manifest manifest = jarfile.getManifest();
      Attributes attrs = (Attributes) manifest.getMainAttributes();
 
      for (Iterator it = attrs.keySet().iterator(); it.hasNext();) {
        Attributes.Name attrName = (Attributes.Name) it.next();
        String attrValue = attrs.getValue(attrName);
        System.out.println(attrName + ": " + attrValue);
      }
 
    } catch (Exception e) {
      System.out.println("There was a problem....");
    }
  }
}

Output:
$ java PrintManifest
Implementation-Vendor: Oracle Corporation
Implementation-Title: Java Runtime Environment
Implementation-Version: 1.8.0_40
Specification-Vendor: Oracle Corporation
Manifest-Version: 1.0
Specification-Title: Java Platform API Specification
Created-By: 1.7.0_07 (Oracle Corporation)
Specification-Version: 1.8

Java command line option that will to tell where classes are loaded from.

Question:
How to tell where classes are loaded into the JVM?

Answer:
If you want to know when and where classes are loaded into the JVM, you can use the "-verbose:class" option on the "java" command.

Code:
public class HelloWorld {
   public static void main(String[] args) {
      System.out.println("Hello, World");
   }
}

Output:
$ java -verbose:class HelloWorld
[Opened /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Object from /jdk7/jre/lib/rt.jar]
[Loaded java.io.Serializable from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Comparable from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.CharSequence from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.String from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.GenericDeclaration from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.Type from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.AnnotatedElement from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Class from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Cloneable from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ClassLoader from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.System from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Throwable from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Error from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ThreadDeath from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Exception from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.RuntimeException from /jdk7/jre/lib/rt.jar]
[Loaded java.security.ProtectionDomain from /jdk7/jre/lib/rt.jar]
[Loaded java.security.AccessControlContext from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ReflectiveOperationException from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ClassNotFoundException from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.LinkageError from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.NoClassDefFoundError from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ClassCastException from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ArrayStoreException from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.VirtualMachineError from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.OutOfMemoryError from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.StackOverflowError from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.IllegalMonitorStateException from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.Reference from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.SoftReference from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.WeakReference from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.FinalReference from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.PhantomReference from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.Finalizer from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Runnable from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Thread from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Thread$UncaughtExceptionHandler from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ThreadGroup from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Map from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Dictionary from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Hashtable from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Properties from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.AccessibleObject from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.Member from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.Field from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.Method from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.Constructor from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.MagicAccessorImpl from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.MethodAccessor from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.MethodAccessorImpl from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.ConstructorAccessor from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.ConstructorAccessorImpl from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.DelegatingClassLoader from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.ConstantPool from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.FieldAccessor from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.FieldAccessorImpl from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.UnsafeFieldAccessorImpl from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.UnsafeStaticFieldAccessorImpl from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.invoke.MethodHandle from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.invoke.MemberName from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.invoke.MethodHandleNatives from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.invoke.LambdaForm from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.invoke.MethodType from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.BootstrapMethodError from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.invoke.CallSite from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.invoke.ConstantCallSite from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.invoke.MutableCallSite from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.invoke.VolatileCallSite from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Appendable from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.AbstractStringBuilder from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.StringBuffer from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.StringBuilder from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.StackTraceElement from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.Buffer from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.PostVMInitHook from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Boolean from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Character from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Number from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Float from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Double from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Byte from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Short from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Integer from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Long from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.NullPointerException from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ArithmeticException from /jdk7/jre/lib/rt.jar]
[Loaded java.io.ObjectStreamField from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Comparator from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.String$CaseInsensitiveComparator from /jdk7/jre/lib/rt.jar]
[Loaded java.security.Guard from /jdk7/jre/lib/rt.jar]
[Loaded java.security.Permission from /jdk7/jre/lib/rt.jar]
[Loaded java.security.BasicPermission from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.RuntimePermission from /jdk7/jre/lib/rt.jar]
[Loaded java.security.AccessController from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.ReflectPermission from /jdk7/jre/lib/rt.jar]
[Loaded java.security.PrivilegedAction from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.ReflectionFactory$GetReflectionFactoryAction from /jdk7/jre/lib/rt.jar]
[Loaded java.security.cert.Certificate from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Iterable from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collection from /jdk7/jre/lib/rt.jar]
[Loaded java.util.List from /jdk7/jre/lib/rt.jar]
[Loaded java.util.RandomAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.util.AbstractCollection from /jdk7/jre/lib/rt.jar]
[Loaded java.util.AbstractList from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Vector from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Stack from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.ReflectionFactory from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.Reference$Lock from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.Reference$ReferenceHandler from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.ReferenceQueue from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.ReferenceQueue$Null from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.ReferenceQueue$Lock from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ref.Finalizer$FinalizerThread from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Map$Entry from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Hashtable$Entry from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Math from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.VM from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.charset.Charset from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.charset.spi.CharsetProvider from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.FastCharsetProvider from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.StandardCharsets from /jdk7/jre/lib/rt.jar]
[Loaded java.util.AbstractMap from /jdk7/jre/lib/rt.jar]
[Loaded sun.util.PreHashedMap from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.StandardCharsets$Aliases from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.StandardCharsets$Classes from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.StandardCharsets$Cache from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ThreadLocal from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.atomic.AtomicInteger from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Unsafe from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.IncompatibleClassChangeError from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.NoSuchMethodError from /jdk7/jre/lib/rt.jar]
[Loaded java.util.ArrayList from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Set from /jdk7/jre/lib/rt.jar]
[Loaded java.util.AbstractSet from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$EmptySet from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$EmptyList from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$EmptyMap from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$UnmodifiableCollection from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$UnmodifiableList from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$UnmodifiableRandomAccessList from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.Reflection from /jdk7/jre/lib/rt.jar]
[Loaded java.util.HashMap from /jdk7/jre/lib/rt.jar]
[Loaded java.util.HashMap$Entry from /jdk7/jre/lib/rt.jar]
[Loaded java.util.HashMap$EntrySet from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Iterator from /jdk7/jre/lib/rt.jar]
[Loaded java.util.HashMap$HashIterator from /jdk7/jre/lib/rt.jar]
[Loaded java.util.HashMap$EntryIterator from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Class$3 from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.Modifier from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.LangReflectAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.ReflectAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Arrays from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.HistoricallyNamedCharset from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.Unicode from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.UTF_8 from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Class$1 from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.ReflectionFactory$1 from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.NativeConstructorAccessorImpl from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.DelegatingConstructorAccessorImpl from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.StringCoding from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ThreadLocal$ThreadLocalMap from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ThreadLocal$ThreadLocalMap$Entry from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.StringCoding$StringDecoder from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.ArrayDecoder from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.charset.CharsetDecoder from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.UTF_8$Decoder from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.charset.CodingErrorAction from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Hashtable$EntrySet from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$SynchronizedCollection from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$SynchronizedSet from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Enumeration from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Hashtable$Enumerator from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Runtime from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Version from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.AutoCloseable from /jdk7/jre/lib/rt.jar]
[Loaded java.io.Closeable from /jdk7/jre/lib/rt.jar]
[Loaded java.io.InputStream from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FileInputStream from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FileDescriptor from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.JavaIOFileDescriptorAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FileDescriptor$1 from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.SharedSecrets from /jdk7/jre/lib/rt.jar]
[Loaded java.io.Flushable from /jdk7/jre/lib/rt.jar]
[Loaded java.io.OutputStream from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FileOutputStream from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FilterInputStream from /jdk7/jre/lib/rt.jar]
[Loaded java.io.BufferedInputStream from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.atomic.AtomicReferenceFieldUpdater from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl from /jdk7/jre/lib/rt.jar]
[Loaded sun.reflect.misc.ReflectUtil from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.Proxy from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.InvocationHandler from /jdk7/jre/lib/rt.jar]
[Loaded java.util.WeakHashMap from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Hashing from /jdk7/jre/lib/rt.jar]
[Loaded java.util.WeakHashMap$Entry from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$SynchronizedMap from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FilterOutputStream from /jdk7/jre/lib/rt.jar]
[Loaded java.io.PrintStream from /jdk7/jre/lib/rt.jar]
[Loaded java.io.BufferedOutputStream from /jdk7/jre/lib/rt.jar]
[Loaded java.io.Writer from /jdk7/jre/lib/rt.jar]
[Loaded java.io.OutputStreamWriter from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.StreamEncoder from /jdk7/jre/lib/rt.jar]
[Loaded sun.security.action.GetPropertyAction from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.ArrayEncoder from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.charset.CharsetEncoder from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.UTF_8$Encoder from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.ByteBuffer from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.HeapByteBuffer from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.Bits from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.ByteOrder from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.JavaNioAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.Bits$1 from /jdk7/jre/lib/rt.jar]
[Loaded java.io.BufferedWriter from /jdk7/jre/lib/rt.jar]
[Loaded java.io.File from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FileSystem from /jdk7/jre/lib/rt.jar]
[Loaded java.io.UnixFileSystem from /jdk7/jre/lib/rt.jar]
[Loaded java.io.ExpiringCache from /jdk7/jre/lib/rt.jar]
[Loaded java.util.LinkedHashMap from /jdk7/jre/lib/rt.jar]
[Loaded java.io.ExpiringCache$1 from /jdk7/jre/lib/rt.jar]
[Loaded java.util.LinkedHashMap$Entry from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ClassLoader$3 from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Enum from /jdk7/jre/lib/rt.jar]
[Loaded java.io.File$PathStatus from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.StringCoding$StringEncoder from /jdk7/jre/lib/rt.jar]
[Loaded java.io.ExpiringCache$Entry from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ClassLoader$NativeLibrary from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Terminator from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.SignalHandler from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Terminator$1 from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Signal from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.NativeSignalHandler from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.OSEnvironment from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.JavaLangAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.System$2 from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.IllegalArgumentException from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Compiler from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Compiler$1 from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Launcher from /jdk7/jre/lib/rt.jar]
[Loaded java.net.URLStreamHandlerFactory from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$Factory from /jdk7/jre/lib/rt.jar]
[Loaded java.security.SecureClassLoader from /jdk7/jre/lib/rt.jar]
[Loaded java.net.URLClassLoader from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$ExtClassLoader from /jdk7/jre/lib/rt.jar]
[Loaded sun.security.util.Debug from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.ClassLoader$ParallelLoaders from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Random from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.ThreadLocalRandom from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.atomic.AtomicLong from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.ThreadLocalRandom$1 from /jdk7/jre/lib/rt.jar]
[Loaded java.util.WeakHashMap$Holder from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Collections$SetFromMap from /jdk7/jre/lib/rt.jar]
[Loaded java.util.WeakHashMap$KeySet from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.JavaNetAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.net.URLClassLoader$7 from /jdk7/jre/lib/rt.jar]
[Loaded java.util.StringTokenizer from /jdk7/jre/lib/rt.jar]
[Loaded java.security.PrivilegedExceptionAction from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$ExtClassLoader$1 from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.MetaIndex from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Readable from /jdk7/jre/lib/rt.jar]
[Loaded java.io.Reader from /jdk7/jre/lib/rt.jar]
[Loaded java.io.BufferedReader from /jdk7/jre/lib/rt.jar]
[Loaded java.io.InputStreamReader from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FileReader from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.cs.StreamDecoder from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.CharBuffer from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.HeapCharBuffer from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.charset.CoderResult from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.charset.CoderResult$Cache from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.charset.CoderResult$1 from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.charset.CoderResult$2 from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.IoTrace from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.reflect.Array from /jdk7/jre/lib/rt.jar]
[Loaded java.util.HashMap$Holder from /jdk7/jre/lib/rt.jar]
[Loaded sun.net.www.ParseUtil from /jdk7/jre/lib/rt.jar]
[Loaded java.util.BitSet from /jdk7/jre/lib/rt.jar]
[Loaded java.net.URL from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Hashtable$Holder from /jdk7/jre/lib/rt.jar]
[Loaded java.net.URL$1 from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Locale from /jdk7/jre/lib/rt.jar]
[Loaded sun.util.locale.LocaleObjectCache from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Locale$Cache from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.ConcurrentMap from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.ConcurrentHashMap from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.ConcurrentHashMap$HashEntry from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.locks.Lock from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.locks.ReentrantLock from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.ConcurrentHashMap$Segment from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.ConcurrentHashMap$Holder from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.locks.AbstractOwnableSynchronizer from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.locks.AbstractQueuedSynchronizer from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.locks.ReentrantLock$Sync from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.locks.ReentrantLock$NonfairSync from /jdk7/jre/lib/rt.jar]
[Loaded java.util.concurrent.locks.AbstractQueuedSynchronizer$Node from /jdk7/jre/lib/rt.jar]
[Loaded sun.util.locale.BaseLocale from /jdk7/jre/lib/rt.jar]
[Loaded sun.util.locale.BaseLocale$Cache from /jdk7/jre/lib/rt.jar]
[Loaded sun.util.locale.BaseLocale$Key from /jdk7/jre/lib/rt.jar]
[Loaded sun.util.locale.LocaleObjectCache$CacheEntry from /jdk7/jre/lib/rt.jar]
[Loaded java.util.Locale$LocaleKey from /jdk7/jre/lib/rt.jar]
[Loaded sun.util.locale.LocaleUtils from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.CharacterData from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.CharacterDataLatin1 from /jdk7/jre/lib/rt.jar]
[Loaded java.net.Parts from /jdk7/jre/lib/rt.jar]
[Loaded java.net.URLStreamHandler from /jdk7/jre/lib/rt.jar]
[Loaded sun.net.www.protocol.file.Handler from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.JavaSecurityAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.security.ProtectionDomain$1 from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.JavaSecurityProtectionDomainAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.security.ProtectionDomain$3 from /jdk7/jre/lib/rt.jar]
[Loaded java.security.CodeSource from /jdk7/jre/lib/rt.jar]
[Loaded java.security.ProtectionDomain$Key from /jdk7/jre/lib/rt.jar]
[Loaded java.security.Principal from /jdk7/jre/lib/rt.jar]
[Loaded java.util.HashSet from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.URLClassPath from /jdk7/jre/lib/rt.jar]
[Loaded sun.net.www.protocol.jar.Handler from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$AppClassLoader from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$AppClassLoader$1 from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.SystemClassLoaderAction from /jdk7/jre/lib/rt.jar]
[Loaded sun.launcher.LauncherHelper from /jdk7/jre/lib/rt.jar]
[Loaded java.net.URLClassLoader$1 from /jdk7/jre/lib/rt.jar]
[Loaded sun.net.util.URLUtil from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.URLClassPath$3 from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.URLClassPath$Loader from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.URLClassPath$JarLoader from /jdk7/jre/lib/rt.jar]
[Loaded java.util.zip.ZipConstants from /jdk7/jre/lib/rt.jar]
[Loaded java.util.zip.ZipFile from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.JavaUtilZipFileAccess from /jdk7/jre/lib/rt.jar]
[Loaded java.util.zip.ZipFile$2 from /jdk7/jre/lib/rt.jar]
[Loaded java.security.PrivilegedActionException from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.URLClassPath$FileLoader from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Resource from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.URLClassPath$FileLoader$1 from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.ByteBuffered from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.PerfCounter from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Perf$GetPerfAction from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.Perf from /jdk7/jre/lib/rt.jar]
[Loaded sun.misc.PerfCounter$CoreCounters from /jdk7/jre/lib/rt.jar]
[Loaded sun.nio.ch.DirectBuffer from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.MappedByteBuffer from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.DirectByteBuffer from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.LongBuffer from /jdk7/jre/lib/rt.jar]
[Loaded java.nio.DirectLongBufferU from /jdk7/jre/lib/rt.jar]
[Loaded java.security.PermissionCollection from /jdk7/jre/lib/rt.jar]
[Loaded java.security.Permissions from /jdk7/jre/lib/rt.jar]
[Loaded java.net.URLConnection from /jdk7/jre/lib/rt.jar]
[Loaded sun.net.www.URLConnection from /jdk7/jre/lib/rt.jar]
[Loaded sun.net.www.protocol.file.FileURLConnection from /jdk7/jre/lib/rt.jar]
[Loaded sun.net.www.MessageHeader from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FilePermission from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FilePermission$1 from /jdk7/jre/lib/rt.jar]
[Loaded java.io.FilePermissionCollection from /jdk7/jre/lib/rt.jar]
[Loaded java.security.AllPermission from /jdk7/jre/lib/rt.jar]
[Loaded java.security.UnresolvedPermission from /jdk7/jre/lib/rt.jar]
[Loaded java.security.BasicPermissionCollection from /jdk7/jre/lib/rt.jar]
[Loaded HelloWorld from file:/tmp/]
[Loaded java.lang.Void from /jdk7/jre/lib/rt.jar]
Hello, World
[Loaded java.lang.Shutdown from /jdk7/jre/lib/rt.jar]
[Loaded java.lang.Shutdown$Lock from /jdk7/jre/lib/rt.jar]