Environmental Variable help in Vista

I am having problems getting my java environmental variables set in windows vista. I do not know if I am soing something wrong or if they maybe some compatibility issues with vista. I go to start right click computer select properties to bring up the system screen then I click change settings to bring up the system properties screen where I select the advanced tab, then select the environmental variables. I understand that the user variables are used to configure for the current user while the system variables are used for all user across the OS.

I create a variable named class path and enter the variables location/bin but still to no avail please help.

actually the name is CLASSPATH and here is the exact variable string I am using (.;C:\Program Files\Java\jre1.6.0\lib\ext\QTJava.zip;.;C:\j2sdk1.4.2_14\bin) I have tried it with this--> ;.; and like this--> ; but neither method seems to solve my problem

[941 byte] By [bigmacshawn@optonline.neta] at [2007-11-27 7:44:02]
# 1

I don't use Vista, and I don't know what you mean by "doesn't work," but one thing is certain: Don't put C:\j2sdk1.4.2_14\bin on your classpath. No classes should go there.

Also don't put anything in a jre's ext directory on your classpath. Any classes there will automatically be picked up.

jverda at 2007-7-12 19:24:39 > top of Java-index,Java Essentials,New To Java...
# 2
I am saying that I cannot compile through the command line and with jcreator only with netbeans
bigmacshawn@optonline.neta at 2007-7-12 19:24:39 > top of Java-index,Java Essentials,New To Java...
# 3

Whenever I try to compile with JCreator I get the message Invalid path, \bin\javac.exe -classpath "C:\Users\William McKeever\Documents\Created Programs\Java Programs" -d "C:\Users\William McKeever\Documents\Created Programs\Java Programs" "C:\Users\William McKeever\Documents\Created Programs\Java Programs\Abracadabra.java"

and javac command is not recognized and -cp gives me a list of commands.

thanks for the info about JRE it was put their automatically I did not enter that variable. also if I do not put it in classpath then where do I put the variable thanks.

bigmacshawn@optonline.neta at 2007-7-12 19:24:39 > top of Java-index,Java Essentials,New To Java...
# 4
You need to add the JDK bin directory to the PATH variable, not the CLASSPATH.
uncle_alicea at 2007-7-12 19:24:39 > top of Java-index,Java Essentials,New To Java...
# 5

Ok I corrected the problem with my apps not compiling but now they will not run I get this error in the command line:

C:\Users\William McKeever\Documents\Created Programs\Java Programs>java . -cp Form

Exception in thread "main" java.lang.NoClassDefFoundError: /

this is the code for the app:

import javax.swing.*; //imports all the J class components

import javax.swing.ButtonGroup.*;

import javax.swing.border.*;

import java.awt.*;

import java.awt.event.*;

public class Form extends JFrame implements ActionListener

{

JLabel user = new JLabel("Username:");

JTextField name = new JTextField();

JLabel pwd = new JLabel("Password:");

JTextField pass = new JTextField();

JLabel con = new JLabel("Confirm Password:");

JTextField cpwd = new JTextField();

JLabel eml = new JLabel("E-Mail:");

JTextField email = new JTextField();

JLabel cc = new JLabel("Credit Card Number:");

JTextField num = new JTextField();

JLabel type = new JLabel("Credit Card Type:");

JRadioButton Visa = new JRadioButton("Visa");

JRadioButton MC = new JRadioButton("Master Card");

JRadioButton Amerx = new JRadioButton("American Express");

ButtonGroup BG = new ButtonGroup();

//JLabel emon = new JLabel("Expiration Month");

//JLabel eyr = new JLabel("Expiration Year");

String[] expmonths = {"Experation Month", "Jan", "Feb", "Mar", "Apr",

"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };

JComboBox em = new JComboBox(expmonths);

String[] expyear = {"Experation Year", "2006", "2007", "2008", "2009",

"2010" };

JComboBox ey = new JComboBox(expyear);

JLabel trms = new JLabel("Terms And Conditions");

JTextArea terms = new JTextArea(10, 50);

JCheckBox agree = new JCheckBox("I agree to the terms");

JButton sub = new JButton("Submit");

JButton clr = new JButton("Clear");

JButton ret = new JButton("Retrieve");

JButton sav = new JButton("Save");

JMenuBar bar = new JMenuBar();

JMenu menu = new JMenu("File");

JMenuItem open = new JMenuItem("Open");

JMenuItem save = new JMenuItem("Save");

JMenuItem exit = new JMenuItem("Exit");

public Form()

{

BG.add(Visa);

BG.add(MC);

BG.add(Amerx);

terms.setText("You must agree to the terms and conditions...");

Container c = getContentPane();

c.setLayout(new BorderLayout());

terms.setBorder(new TitledBorder("TERMS"));

JPanel jpn = new JPanel();

jpn.setLayout(new GridLayout(1, 3));

JPanel jpn1 = new JPanel();

jpn1.setLayout(new GridLayout(4, 0));

jpn1.add(user);

jpn1.add(pwd);

jpn1.add(con);

jpn1.add(eml);

JPanel jpn2 = new JPanel();

jpn2.setLayout(new GridLayout(4, 0));

jpn2.add(name);

jpn2.add(pass);

jpn2.add(cpwd);

jpn2.add(email);

JPanel jpn3 = new JPanel();

jpn3.setLayout(new FlowLayout());

jpn.add(jpn1);

jpn.add(jpn2);

jpn.add(jpn3);

JPanel jpc = new JPanel(new BorderLayout());

JPanel jpce = new JPanel(new GridLayout(4, 1));

jpce.add(type);

jpce.add(Visa);

jpce.add(MC);

jpce.add(Amerx);

JPanel jpcw = new JPanel(new GridLayout(4, 1, 10, 10));

jpcw.add(cc);

jpcw.add(num);

//jpcw.add(emon);

jpcw.add(em);

//jpcw.add(eyr);

jpcw.add(ey);

JPanel bordr = new JPanel(new GridLayout(2, 1));

bordr.setBorder(new TitledBorder("CreditCard Information"));

jpc.add(bordr);

JPanel jpcb = new JPanel(new GridLayout(3, 1));

jpcb.add(trms);

jpcb.add(terms);

jpcb.add(agree);

JPanel jps = new JPanel(new FlowLayout());

jps.add(sub);

jps.add(clr);

jps.add(sav);

jps.add(ret);

JPanel bordrtop = new JPanel(new GridLayout(1, 2));

bordrtop.add(jpce);

bordrtop.add(jpcw);

JPanel bordrBottom = new JPanel(new BorderLayout());

bordrBottom.add(jpcb);

bordr.add(bordrtop);

bordr.add(bordrBottom);

JPanel main = new JPanel(new BorderLayout());

main.add(jpn, BorderLayout.NORTH);

main.add(jpc, BorderLayout.CENTER);

main.add(jps, BorderLayout.SOUTH);

this.setJMenuBar(bar);

bar.add(menu);

menu.add(open);

menu.add(save);

menu.addSeparator();

menu.add(exit);

c.add(main);

agree.addActionListener(this);

sub.addActionListener(this);

sav.addActionListener(this);

clr.addActionListener(this);

ret.addActionListener(this);

open.addActionListener(this);

save.addActionListener(this);

exit.addActionListener(this);

}

public static void main(String args[])

{

Form c = new Form();

c.setSize(450, 459);

c.setTitle("Credit Card Form");

c.setVisible(true);

c.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

public void actionPerformed(ActionEvent e)

{

String AC = e.getActionCommand();

if((AC).equals("Clear"))

{

name.setText("");

pass.setText("");

cpwd.setText("");

email.setText("");

num.setText("");

Visa.setSelected(false);

MC.setSelected(false);

Amerx.setSelected(false);

agree.setSelected(false);

ey.setSelectedIndex(0);

em.setSelectedIndex(0);

}

else if((AC).equals("Submit"))

{

String Username = name.getText();

String Password = pass.getText();

String Mail = email.getText();

String CCType;

if(Visa.isSelected())

CCType = Visa.getText();

else if(MC.isSelected())

CCType = MC.getText();

else

CCType = Amerx.getText();

//String expmon = StringValueOf(em.getSelectedItem());

//String expyr = StringValueOf(ey.getSelectedItem());

String message = Username + "," + Password + "," + Mail + "," + CCType;

JOptionPane.showMessageDialog(null, message);

}

}

}

bigmacshawn@optonline.neta at 2007-7-12 19:24:39 > top of Java-index,Java Essentials,New To Java...
# 6
Just type "java Form"And when you include source code in your posts, please put them inside [code][/code] tags.
uncle_alicea at 2007-7-12 19:24:39 > top of Java-index,Java Essentials,New To Java...
# 7
thanks now everything works you were great a big help
bigmacshawn@optonline.neta at 2007-7-12 19:24:39 > top of Java-index,Java Essentials,New To Java...