| | |
Please Help me......error in compiling
![]() |
This is due to a missing or incorrect classpath. Classpath tells where to find the files required to compile your program. You specify it by either setting an environment variable CLASSPATH or by using the -cp switch on the javac command: If it is a single file with no other dependencies, you can compile it from within the directory containing the java file without setting the classpath, but you will need to have the jdk/bin directory on your system path or use the full path to javac to invoke it.
Java Syntax (Toggle Plain Text)
javac -cp ./;c:/myProjectDir;c:/otherFilesDir MyProgram.java
•
•
Join Date: Aug 2007
Posts: 4
Reputation:
Solved Threads: 0
hello can i ask for a help....i dont know how to continue with my project..please help me with this..i my project is to make a sample editor that counts the characters, consonants, vowels,symbols and spaces..can u please help me with this...my code as of now..still the layout..
import java.awt.*;
import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.awt.event.*;
import java.util.*;
public class gui2 extends JFrame
{
private static final int WIDTH = 1500;
private static final int HEIGHT = 1500;
private JLabel characL, vowL, consoL, spacesL, symL;
private JTextField characTF, vowTF, consoTF, spacesTF, symTF;
private JTextArea ATA;
public gui2()
{
characL = new JLabel("Characters:", SwingConstants.LEFT);
vowL = new JLabel("Vowels: ", SwingConstants.LEFT);
consoL = new JLabel("Consonants: ", SwingConstants.LEFT);
spacesL = new JLabel("Spaces:", SwingConstants.LEFT);
symL = new JLabel("Symbols:", SwingConstants.LEFT);
characTF = new JTextField(20);
vowTF = new JTextField(20);
consoTF = new JTextField(20);
spacesTF = new JTextField(20);
symTF = new JTextField(20);
ATA = new JTextArea();
setTitle("Jesse's Text Editor");
Container pane = getContentPane();
setLayout(null);
pane.add(ATA);
pane.add(characL);
pane.add(characTF);
pane.add(vowL);
pane.add(vowTF);
pane.add(consoL);
pane.add(consoTF);
pane.add(spacesL);
pane.add(spacesTF);
pane.add(symL);
pane.add(symTF);
ATA.setSize(1000,600);
characL.setSize(100,50);
characTF.setSize(75,50);
vowL.setSize(100,50);
vowTF.setSize(75,50);
consoL.setSize(100,50);
consoTF.setSize(75,50);
spacesL.setSize(100,50);
spacesTF.setSize(75,50);
symL.setSize(100,50);
symTF.setSize(75,50);
ATA.setLocation(80,20);
characL.setLocation(1,700);
characTF.setLocation(80,700);
vowL.setLocation(200,700);
vowTF.setLocation(300,700);
consoL.setLocation(400,700);
consoTF.setLocation(500,700);
spacesL.setLocation(600,700);
spacesTF.setLocation(700,700);
symL.setLocation(800,700);
symTF.setLocation(900,700);
ATA.setBorder(BorderFactory.createLineBorder(Color.black));
ATA.setColumns(50);
ATA.setRows(20);
setSize(WIDTH, HEIGHT);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args)
{
new gui2();
}
}
the code is not good..^^but it runs..still the layout...
import java.awt.*;
import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.awt.event.*;
import java.util.*;
public class gui2 extends JFrame
{
private static final int WIDTH = 1500;
private static final int HEIGHT = 1500;
private JLabel characL, vowL, consoL, spacesL, symL;
private JTextField characTF, vowTF, consoTF, spacesTF, symTF;
private JTextArea ATA;
public gui2()
{
characL = new JLabel("Characters:", SwingConstants.LEFT);
vowL = new JLabel("Vowels: ", SwingConstants.LEFT);
consoL = new JLabel("Consonants: ", SwingConstants.LEFT);
spacesL = new JLabel("Spaces:", SwingConstants.LEFT);
symL = new JLabel("Symbols:", SwingConstants.LEFT);
characTF = new JTextField(20);
vowTF = new JTextField(20);
consoTF = new JTextField(20);
spacesTF = new JTextField(20);
symTF = new JTextField(20);
ATA = new JTextArea();
setTitle("Jesse's Text Editor");
Container pane = getContentPane();
setLayout(null);
pane.add(ATA);
pane.add(characL);
pane.add(characTF);
pane.add(vowL);
pane.add(vowTF);
pane.add(consoL);
pane.add(consoTF);
pane.add(spacesL);
pane.add(spacesTF);
pane.add(symL);
pane.add(symTF);
ATA.setSize(1000,600);
characL.setSize(100,50);
characTF.setSize(75,50);
vowL.setSize(100,50);
vowTF.setSize(75,50);
consoL.setSize(100,50);
consoTF.setSize(75,50);
spacesL.setSize(100,50);
spacesTF.setSize(75,50);
symL.setSize(100,50);
symTF.setSize(75,50);
ATA.setLocation(80,20);
characL.setLocation(1,700);
characTF.setLocation(80,700);
vowL.setLocation(200,700);
vowTF.setLocation(300,700);
consoL.setLocation(400,700);
consoTF.setLocation(500,700);
spacesL.setLocation(600,700);
spacesTF.setLocation(700,700);
symL.setLocation(800,700);
symTF.setLocation(900,700);
ATA.setBorder(BorderFactory.createLineBorder(Color.black));
ATA.setColumns(50);
ATA.setRows(20);
setSize(WIDTH, HEIGHT);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args)
{
new gui2();
}
}
the code is not good..^^but it runs..still the layout...
Last edited by javakeith; Aug 18th, 2007 at 1:16 pm. Reason: forgot something
NoClassDefFound isn't thrown from the compiler, only from the runtime...
So you probably did not in fact compile your class, or indeed forgot to include it on the classpath when trying to execute it.
So you probably did not in fact compile your class, or indeed forgot to include it on the classpath when trying to execute it.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
DO AS FOLLOWING FOR SETTING CLASSPATH:
Setting classpath in jdk 1.6.0
1. install the JDK1.6 from the installation directory
2. Please keep the default path of installation while installing the JDK
generally it would be in the "program files" directory of
System drive. If the system drive is C: then
JDK would be installed at c:\program files\java\jdk1.6 folder
3. right click on "my computer" icon on the desktop.
4. click the property sub menu
5. click the "advanced" tag on the dialog box
6. click on "environment parameters"
7. a dialog box will appear.
look for "system variables" list at the bottom of the dialog box.
8. find out the parameter "path" in the list
9. after selecting the path, click on the edit button
10.a message box will appear with the name "path" and current path value in the bottom text box.
11. append the path of java bin folder with the existing path
the path of java bin folder would be (is installed with default path )
C:\Program Files\Java\jdk1.6.0\bin
append the above path with the existing path
then click OK
12.Now Look for the classpath parameter in the system variable list again.
if No "classpath" parameter is available then
create a new one by clicking "new" button. In the "variable name"
text box give the name "CLASSPATH" and in the
"variable value" text box give the following (if default installation path is choosen)
;.;C:\Program Files\Java\jdk1.6.0\jre\lib\rt.jar
otherwise if the CLASSPATH parameter is already available then
just click the edit button by selecting the existing CLASSPATH and
then append the above CLASSPATH with the exiting one.
click OK
Next
jTextField returns a object
You can get string from jTextField by jTextField.getText.toString()
Setting classpath in jdk 1.6.0
1. install the JDK1.6 from the installation directory
2. Please keep the default path of installation while installing the JDK
generally it would be in the "program files" directory of
System drive. If the system drive is C: then
JDK would be installed at c:\program files\java\jdk1.6 folder
3. right click on "my computer" icon on the desktop.
4. click the property sub menu
5. click the "advanced" tag on the dialog box
6. click on "environment parameters"
7. a dialog box will appear.
look for "system variables" list at the bottom of the dialog box.
8. find out the parameter "path" in the list
9. after selecting the path, click on the edit button
10.a message box will appear with the name "path" and current path value in the bottom text box.
11. append the path of java bin folder with the existing path
the path of java bin folder would be (is installed with default path )
C:\Program Files\Java\jdk1.6.0\bin
append the above path with the existing path
then click OK
12.Now Look for the classpath parameter in the system variable list again.
if No "classpath" parameter is available then
create a new one by clicking "new" button. In the "variable name"
text box give the name "CLASSPATH" and in the
"variable value" text box give the following (if default installation path is choosen)
;.;C:\Program Files\Java\jdk1.6.0\jre\lib\rt.jar
otherwise if the CLASSPATH parameter is already available then
just click the edit button by selecting the existing CLASSPATH and
then append the above CLASSPATH with the exiting one.
click OK
Next
jTextField returns a object
You can get string from jTextField by jTextField.getText.toString()
Last edited by arkaprava; Aug 22nd, 2007 at 2:33 am.
![]() |
Similar Threads
- Error while compiling (C)
- compiling error (C)
- 1 error compiling... (C++)
- Error in compiling matrix (C++)
- Error compiling complex.cpp (C++)
- error when compiling murphy's law with gcc (C)
Other Threads in the Java Forum
- Previous Thread: Changing the icons of JButtons
- Next Thread: problem in accessin table values from access database..
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card character class client code collision component crashcourse css csv database eclipse ee error fractal free game gis givemetehcodez graphics gui html ide image integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linux list loan machine map method methods migrate mobile netbeans newbie objects oriented output panel phone physics problem program programming project projects radio recursion replaydirector reporting researchinmotion scanner se server service set sms software sort sql string swing test textfield threads transfer tree trolltech ubuntu utility windows






