Recommended Posts

Are you logged in as admin?

You don't need to be logged in as admin. UAC allows you to elevate privileges on the fly:

Open the start menu -> right click on Computer then select Properties -> Click on "Advanced system settings" (the UAC elevation prompt will appear) -> click on Environment variables button

Edited by franzon

Ah, excellent. That worked, thank you very much.

If I may, another question. Now javac is being found but: 'java <classname>' returns class not found:

C:\Users\Zapadlo\workspace\Test\src\test_1&gt;javac Sample.java

C:\Users\Zapadlo\workspace\Test\src\test_1&gt;java Sample
Exception in thread "main" java.lang.NoClassDefFoundError: Sample
Caused by: java.lang.ClassNotFoundException: Sample
		at java.net.URLClassLoader$1.run(Unknown Source)
		at java.security.AccessController.doPrivileged(Native Method)
		at java.net.URLClassLoader.findClass(Unknown Source)
		at java.lang.ClassLoader.loadClass(Unknown Source)
		at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
		at java.lang.ClassLoader.loadClass(Unknown Source)
		at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: Sample.  Program will exit.

This is Sample Class:

package test_1;

public class Sample {

	public static void main (String[] Args) {

		System.out.println("Hello World?");
		int i, j;
		i = 5;
		j = 6;
		System.out.println("i + j = " + (i+j));

	}

}

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.