View previous topic :: View next topic |
Author |
Message |
dalibred Just Arrived
Joined: 19 Nov 2003 Posts: 0
|
Posted: Sat Dec 13, 2003 3:47 pm Post subject: Java |
|
|
hi, i wonder if i can get help with this problem
i cannot run the "java" command fromn the command line, the "javac"command runs ok and produces the class file but the java command gives an error " exception in thread "main" noclassdeffounderror: " and i think this is making me unable to run jlex and cup files from my windows machine, i normally use linux, but having to make do with windows for the time being.
the other thing is programs compile and execute ok using "JCreator" but for the need of running jlex and cup files i need the command line to work.
|
|
Back to top |
|
|
flw Forum Fanatic
Joined: 27 May 2002 Posts: 16777215 Location: U.S.A.
|
|
Back to top |
|
|
Dforce101 Just Arrived
Joined: 14 May 2004 Posts: 0 Location: NY
|
Posted: Mon May 24, 2004 3:38 pm Post subject: |
|
|
Maybe a stupid question since i don't know your programing skill level... but the java program you are trying to run... sounds like u don't have the main argument in the code so u can run the app?
public static void main(String[] args)
|
|
Back to top |
|
|
el-half Just Arrived
Joined: 01 Jan 2004 Posts: 0 Location: Cyberspace
|
Posted: Tue May 25, 2004 12:45 pm Post subject: |
|
|
You have to mess with the CLASSPATH variable.
If it still doesn't work you can still run your Java apps by cd'ing to the correct directory and using this: java -cp . AFile.class
|
|
Back to top |
|
|
grith Just Arrived
Joined: 28 May 2004 Posts: 0
|
Posted: Sat May 29, 2004 11:15 pm Post subject: |
|
|
try typing java -classpath .;.;
this should work
|
|
Back to top |
|
|
siva210383 Just Arrived
Joined: 06 Jul 2004 Posts: 0 Location: India
|
Posted: Wed Jul 07, 2004 9:56 pm Post subject: |
|
|
hey its very simple the error occurs only if u hav different names for ur java file and the class containing the main function.... r u sure u hav used a same name for both ur java file and ur class containing the main function???
|
|
Back to top |
|
|
jennefer Just Arrived
Joined: 12 Dec 2005 Posts: 0
|
Posted: Mon Dec 12, 2005 1:15 pm Post subject: JLex and CUP |
|
|
hey, I,m also having the same problem... i also want to use JLex and CUP for our thesis... the problem is that I cannot install these softwares... please help me... i'm wondering, whether I can use JLex with JCreator... please teach me... please email me at axessyy@yahoo.com VERY,VERY SOON... THANKS...
|
|
Back to top |
|
|
vjy Just Arrived
Joined: 05 May 2004 Posts: 0
|
Posted: Mon Dec 12, 2005 2:28 pm Post subject: |
|
|
Hey guys,
you need to have a variable called CLASSPATH in your environment variables and you need to have the value of the CLASSPATH as . which means current directory.
e.g. CLASSPATH = .;
Add this and re-run the program and it will work fine.
Hope this helps.
Thanks
|
|
Back to top |
|
|
|