| | |
Java Problem with running program
![]() |
•
•
Join Date: Aug 2004
Posts: 15
Reputation:
Solved Threads: 0
Hello,
This may not be the right forum for this but here goes...I am a student and am taking programming classes( JAVA ). It seems that I can compile my programs but cannot run them. My professor said my path was incorrect and gave me the correct path settings. I edited my path and made it exactly the same as the path he showed me. I still get nothing. I have not installed or uninstalled anything within months..What is funny is last year when I started this it ran and compiled fine. Then it would only run applets..now it runs nothing. The funny thing is my professor told me the way my path was nothing should have compiled or ran..After I change it..nothing runs..I tried changing it back to my old path but it still only compiles andwill not run.
I am using j2sdk1.4.1 on winxp servicepack1. The error reads Exception in thread "main" java.lang.NoClassDefFoundError:
My major problem I have a Final project and know way to test my code please help.
This may not be the right forum for this but here goes...I am a student and am taking programming classes( JAVA ). It seems that I can compile my programs but cannot run them. My professor said my path was incorrect and gave me the correct path settings. I edited my path and made it exactly the same as the path he showed me. I still get nothing. I have not installed or uninstalled anything within months..What is funny is last year when I started this it ran and compiled fine. Then it would only run applets..now it runs nothing. The funny thing is my professor told me the way my path was nothing should have compiled or ran..After I change it..nothing runs..I tried changing it back to my old path but it still only compiles andwill not run.
I am using j2sdk1.4.1 on winxp servicepack1. The error reads Exception in thread "main" java.lang.NoClassDefFoundError:
My major problem I have a Final project and know way to test my code please help.
Tell me where your java installation is located on your hard drive.
it should be a folder something like j2sdk-xxxxx.
Also tell me if there is a folder called bin within j2sdk-xxxxx. Then tell me if there is a program called java.exe in there.
You can also install netbeans or eclipse. IDEs usually do the right thing.
Hope you can get back on your feet soon!
Ed
it should be a folder something like j2sdk-xxxxx.
Also tell me if there is a folder called bin within j2sdk-xxxxx. Then tell me if there is a program called java.exe in there.
You can also install netbeans or eclipse. IDEs usually do the right thing.
Hope you can get back on your feet soon!
Ed
•
•
•
•
In a world without walls or fences,
What use are Windows and Gates.
Go to where your program is and
try C:\j2sdk1.4.1\bin\java YourProgram
or C:\j2sdk1.4.1\jre\bin\java YourProgram
Let me know what happens and what error you get when you do this.
Ed
try C:\j2sdk1.4.1\bin\java YourProgram
or C:\j2sdk1.4.1\jre\bin\java YourProgram
Let me know what happens and what error you get when you do this.
Ed
•
•
•
•
Originally Posted by ZEEPLE
Hello again,
Thanks for responding so quicky...
C:\j2sdk1.4.1 is where the folder is....
C:\j2sdk1.4.1\bin lies within the C:\j2sdk1.4.1 folder...
and yes...the java.exe is in the bin folder....
![]()
•
•
•
•
In a world without walls or fences,
What use are Windows and Gates.
•
•
Join Date: Aug 2004
Posts: 15
Reputation:
Solved Threads: 0
Hello Ed,
Tried your suggestion, but to no avail...Here is my path...do you see anything that could be worng with it....
C:\j2sdk1.4.1;C:\j2sdk1.4.\bin;C:\j2sdk1.4.\jre;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATITechnologies\ATI Control Panel;C:\Program Files\MicrosoftOffice\OFFICE11\Business Contact Manager\IM;C:\Program Files\MicrosoftSQL Server\80\Tools\Binn\;
Tried your suggestion, but to no avail...Here is my path...do you see anything that could be worng with it....
C:\j2sdk1.4.1;C:\j2sdk1.4.\bin;C:\j2sdk1.4.\jre;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATITechnologies\ATI Control Panel;C:\Program Files\MicrosoftOffice\OFFICE11\Business Contact Manager\IM;C:\Program Files\MicrosoftSQL Server\80\Tools\Binn\;
Hey Zeeple,
What happens when you type what I said? type the whole path I told you and tell me what error message you see. That's the only way I can help you short of paying you a visit
Ed
What happens when you type what I said? type the whole path I told you and tell me what error message you see. That's the only way I can help you short of paying you a visit
Ed
•
•
•
•
Originally Posted by ZEEPLE
Hello Ed,
Tried your suggestion, but to no avail...Here is my path...do you see anything that could be worng with it....
C:\j2sdk1.4.1;C:\j2sdk1.4.\bin;C:\j2sdk1.4.\jre;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATITechnologies\ATI Control Panel;C:\Program Files\MicrosoftOffice\OFFICE11\Business Contact Manager\IM;C:\Program Files\MicrosoftSQL Server\80\Tools\Binn\;
•
•
•
•
In a world without walls or fences,
What use are Windows and Gates.
Now in the directory that you ran java, can you tell me what you have there?
do a 'dir' and show me the file listing. also show me the first few lines of that java file that you're trying to run.
also, did you set JAVA_HOME="C:\j2sdk1.4.1"?
Ed
do a 'dir' and show me the file listing. also show me the first few lines of that java file that you're trying to run.
also, did you set JAVA_HOME="C:\j2sdk1.4.1"?
Ed
•
•
•
•
In a world without walls or fences,
What use are Windows and Gates.
•
•
Join Date: Aug 2004
Posts: 15
Reputation:
Solved Threads: 0
Hey,
Well you lost me with the set JAVA_HOME="c:\j2sdk1.4.1"...where do you do that?
here is a pic of my file listing.
here is a snipit of code that is good I have seen it work...
public class DateTime2 extends Applet
{
private static Date now; //Date variable
//Add a main method to enable the applet to run as an application
public static void main(String[] args)
{
Frame f = new Frame(); //Create a new frame object
DateTime2 dateTime = new DateTime2(); //Create an instance of DateTime2
//Add the new instance into the frame
f.setLayout(new BorderLayout());
f.add("Center", dateTime);
f.setSize(200,255);
f.setVisible(true);
//An "anonymous" inner class used to close the window
f.addWindowListener( new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
}
);
dateTime.init(); //Call the applet's init method
} //End of main
Now this is not the DrawHouse code but this does not work either...Now this code functions as an applet and an application. I got this from another forum to learn how to combine the two. It does work at school but not at my home..again it compiles but does not run..
Well you lost me with the set JAVA_HOME="c:\j2sdk1.4.1"...where do you do that?
here is a pic of my file listing.
here is a snipit of code that is good I have seen it work...
public class DateTime2 extends Applet
{
private static Date now; //Date variable
//Add a main method to enable the applet to run as an application
public static void main(String[] args)
{
Frame f = new Frame(); //Create a new frame object
DateTime2 dateTime = new DateTime2(); //Create an instance of DateTime2
//Add the new instance into the frame
f.setLayout(new BorderLayout());
f.add("Center", dateTime);
f.setSize(200,255);
f.setVisible(true);
//An "anonymous" inner class used to close the window
f.addWindowListener( new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
}
);
dateTime.init(); //Call the applet's init method
} //End of main
Now this is not the DrawHouse code but this does not work either...Now this code functions as an applet and an application. I got this from another forum to learn how to combine the two. It does work at school but not at my home..again it compiles but does not run..
Please show me the first few lines of your code. It's important. If you have a package ... statement at the top, it could cause you problems if you don't put it in the right place.
So one file at a time Please show me just the first few lines of DrawHouse.
Ed
So one file at a time Please show me just the first few lines of DrawHouse.
Ed
•
•
•
•
In a world without walls or fences,
What use are Windows and Gates.
![]() |
Similar Threads
Other Threads in the Java Forum
- Previous Thread: ant build process is not working
- Next Thread: Total New person - Help with a game....
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor crashcourse database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress integer intellij j2me java javadoc javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program programming project radio recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows





