How to get Java Installation location?

package com.pretech;
public class JavaHome {
	public static void main(String[] args) {
		System.out.println(System.getProperty("java.home"));
	}
}

Output



C:\Program Files\Java\jdk1.7.0_06\jre


No comments:

Post a Comment

12 classic String-based Java interview questions with simple explanations and code.

  1️⃣ Check if a String is a Palindrome Problem Given a string, check if it reads the same forward and backward. Example: "madam...

Featured Posts