Bug 37353 add variable button can't add variable only edit. [build path}
Project->properties->java build path->Library tab->add variable button will only allow you to extend or edit a variable not add a variable. The only way to add a classpath variable is to go Window->preferences->java->classpath variables->new button.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/NewVariableEntryDialog.java
fResultPaths= extendedPaths;
				super.buttonPressed(IDialogConstants.OK_ID);
			}
		}
	}
		
	protected void configButtonPressed() {
		ClasspathVariablesPreferencePage page= new ClasspathVariablesPreferencePage();
		showPreferencePage(ClasspathVariablesPreferencePage.ID, page);
		initializeElements();
	}	
	
	private boolean showPreferencePage(String id, IPreferencePage page) {
		final IPreferenceNode targetNode = new PreferenceNode(id, page);
		
		PreferenceManager manager = new PreferenceManager();
		manager.addToRoot(targetNode);
		final PreferenceDialog dialog = new PreferenceDialog(getShell(), manager);
		final boolean [] result = new boolean[] { false };
		BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
			public void run() {
				dialog.create();
				dialog.setMessage(targetNode.getLabelText());
				result[0]= (dialog.open() == Window.OK);
			}
		});
		return result[0];
	}		
}