Changing default JDK in Mac OS X Mavericks
/usr/libexec/java_home -V
Juni 19, 2014 By Firman
Mei 14, 2014 By Firman
April 07, 2014 By Firman
/Library/Java/JavaVirtualMachines/jdk.1.7.<…>/Contents/<key>JVMCapabilities</key>
<array>
<string>CommandLine</string>
</array><key>JVMCapabilities</key>
<array>
<string>JNI</string>
<string>BundledApp</string>
<string>WebStart</string>
<string>Applets</string>
<string>CommandLine</string>
</array>Mei 24, 2013 By Firman
Januari 21, 2013 By Firman
sudo apt-get purge openjdk*If you installed java 7 from any other PPA and you are having problem with java then you have to do following steps before installing the PPA menctioned here
sudo rm /var/lib/dpkg/info/oracle-java7-installer*Install oracle java 7 in ubuntu 12.04
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Agustus 06, 2012 By Firman
April 15, 2012 By Firman
Oktober 24, 2011 By Firman
Juni 17, 2011 By Firman
Mei 16, 2011 By Firman
Components Debugger Interfaces |
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8765 |
-Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000 |
Remote Java Application by going to the Eclipse menu and selecting Run > Debug Configurations..., then selecting the connector from the dropdown list. Two connectors are provided in Ganymede:package com.ibm.developerWorks.debugtest; |
System.out.println("This is a test.");.java -jar test.jar |
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address="8000" -jar |
java -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000,suspend=y |
April 18, 2011 By Firman
April 10, 2011 By Firman
main() method must indeed have a void return type. From the Java Language Specification on "Execution - Virtual Machine Start-Up" (§12.1.4): The method main must be declared public, static, and void. It must accept a single argument that is an array of strings.exit method of class Runtime or class System and the exit operation is not forbidden by the security manager.main method finishes; a return value frommain would therefore be meaningless. Therefore the return value of main is void.package test;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
public class ThreadTest {
/**
* @param args
* @throws InterruptedException
*/
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.out.println("The current main thread: "
+ Thread.currentThread().getName());
printAllThreads();
ThreadA tc = new ThreadA();
tc.start();
tc.join();
// Thread.sleep(5000);
System.out.println("Exiting main thread.");
}
static private void printAllThreads() {
MapstackTraces = Thread
.getAllStackTraces();
Set< Entry> entrySet = stackTraces
.entrySet();
for (Entryentry : entrySet) {
Thread t = entry.getKey();
System.out.println(">>>>>>>>>> " + t.getName());
}
}
}