Bug 24199 New Classpath Variables
Why should a full rebuild of the workspace be required when you add a classpath variable? Because it's a new variable it doesn't affect any existing projects. It would be more convenient if a rebuild were not required when adding a new classpath variable. Thanks.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/VariableBlock.java
String[] names= new String[nVariables];
				IPath[] paths= new IPath[nVariables];
				int k= 0;
				
				for (int i= 0; i < fToChange.size(); i++) {
					CPVariableElement curr= (CPVariableElement) fToChange.get(i);
					names[k]= curr.getName();
					paths[k]= curr.getPath();
					k++;
				}
				for (int i= 0; i < fToRemove.size(); i++) {
					names[k]= (String) fToRemove.get(i);
					paths[k]= null;
					k++;					
				}
				JavaCore.setClasspathVariables(names, paths, new SubProgressMonitor(monitor, 1));
				
				if (fDoBuild) {
					JavaPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, new SubProgressMonitor(monitor, 1));
				}
				
			} catch (CoreException e) {
				throw new InvocationTargetException(e);
			} finally {
				monitor.done();
			}
		}
	}
}