Java

Networking/Security Forums -> Programming and More

Author: dalibred PostPosted: 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.

Author: flwLocation: U.S.A. PostPosted: Sun Dec 14, 2003 2:02 am    Post subject:
    ----
Have your already look thrugh these? http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=noclassdeffounderror&btnG=Google+Search

Author: Dforce101Location: NY PostPosted: 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)

Author: el-halfLocation: Cyberspace PostPosted: 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

Author: grith PostPosted: Sat May 29, 2004 11:15 pm    Post subject:
    ----
try typing java -classpath .;.;
this should work

Author: siva210383Location: India PostPosted: 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???

Author: jennefer PostPosted: 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...

Author: vjy PostPosted: 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



Networking/Security Forums -> Programming and More


output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group