Please Help me......error in compiling

Reply

Join Date: Aug 2007
Posts: 4
Reputation: javakeith is an unknown quantity at this point 
Solved Threads: 0
javakeith javakeith is offline Offline
Newbie Poster

Please Help me......error in compiling

 
0
  #1
Aug 16th, 2007
im trying to compile a java file in my computer...and it wil not work...its my first time doin it here...

my problem was..i cant compile any java file...


this will only appear


java.lang.NoClassDefFoundError: mynote/java
Exception in thread "main"
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,438
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 510
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Please Help me......error in compiling

 
0
  #2
Aug 16th, 2007
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:
  1. javac -cp ./;c:/myProjectDir;c:/otherFilesDir MyProgram.java
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 4
Reputation: javakeith is an unknown quantity at this point 
Solved Threads: 0
javakeith javakeith is offline Offline
Newbie Poster

Re: Please Help me......error in compiling

 
0
  #3
Aug 18th, 2007
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...
Last edited by javakeith; Aug 18th, 2007 at 1:16 pm. Reason: forgot something
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Please Help me......error in compiling

 
0
  #4
Aug 18th, 2007
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 4
Reputation: javakeith is an unknown quantity at this point 
Solved Threads: 0
javakeith javakeith is offline Offline
Newbie Poster

Re: Please Help me......error in compiling

 
0
  #5
Aug 18th, 2007
how can i get the result from a TextArea and place it on a TextField??....anyone who knows?
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 706
Reputation: stultuske is a jewel in the rough stultuske is a jewel in the rough stultuske is a jewel in the rough 
Solved Threads: 84
stultuske's Avatar
stultuske stultuske is offline Offline
Master Poster

Re: Please Help me......error in compiling

 
0
  #6
Aug 21st, 2007
getSelectedText(); setText(); should do the trick.
just go through the api's
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 34
Reputation: arkaprava is an unknown quantity at this point 
Solved Threads: 0
arkaprava's Avatar
arkaprava arkaprava is offline Offline
Light Poster

Re: Please Help me......error in compiling

 
0
  #7
Aug 22nd, 2007
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()
Last edited by arkaprava; Aug 22nd, 2007 at 2:33 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 1
Reputation: sat11 is an unknown quantity at this point 
Solved Threads: 0
sat11 sat11 is offline Offline
Newbie Poster

Re: Please Help me......error in compiling

 
0
  #8
Aug 22nd, 2007
set path of java home directory and bin directory separately in environment variable
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 14
Reputation: w32.sysfile is an unknown quantity at this point 
Solved Threads: 0
w32.sysfile w32.sysfile is offline Offline
Newbie Poster

Re: Please Help me......error in compiling

 
0
  #9
Aug 25th, 2007
problem in main

should be

public static void main(String[]args)
{
gui2 myprogram=new gui2();
myprogram.setVisible(true);
myprogram.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myprogram.setSize(blah2,blah2);
}
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC