FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Java classpath problem





internetjobs
i am using various version of java on a single machine..

i have lot of path problem, i set path on Environment variable. and class path to ".;", still i have the same problem "Exception in thread "main" java.lang.NoSuchMethodError: main"

please help me

and another problem that with registry it saying "1.3 requied and registry value have 1.4"

plese help to solve the problem and i tried to set path temporary in command prompt for class path like "set classpath=.;
muggle
It will surely help if you post more details e.g. piece of code and what exactly you want to put in your CLASSPATH variable.
As a beginning - the name of the CLASSPATH variable in the environment is expected to be in upper case; and `main` won't be found if you didn't define it.
blueray
It also be notice that if the main entry point are located in different namespaces,
than you may need to place it in correct namespace.


Hope this Help,
mike_phi
Ok to start with you need to tidy up your environment and decide which version of java you want to use.

about not finding main has nothing to do with the version of java you are using it has something to do with how you are invoking your program/application.

basicacally your Java runtime environment dose not find the app you are trying.

to make sure you are finding a java RE basically type java -version at the command prompt, this should give you the version.

then have a look at your class is it in a java packag. if it packaged you will first of all make sure it has been complied and note where the class files are.

if it is in a package you can go directly to where the source is and compile it but when you attempt to run it you will have to CD out to the base of the package and run it from there java <base package>class.java

dont bother setting the CLASSPATH just include it in your run command i.e. java -CLASSPATH .;/which ever jars you need <base package>class.java


good luck if you need any more help just ask you could give more detail and get more detailed help aslo you could try to do it the easier way (not recommended if the purpose of this excercise is to help you understand java more) you could just set up a project in eclipse or NetBeans its really good and really easy, but try it yourself first without the editors, its great to understand java fully before you wrap the detail behind an IDE

cheers Mic
Related topics
Java Refresh Problem
Java bufferedReader problem
JAVA Trouble
problem z services.exe
Java Problem
Javascript problem...I think :S
just a java problem
Java vs. C++
problem with java script file
JAVA CLASSPATH
Problem with javax.sound.midi (Java)
Java Classpath configuration.
java applet refresh problem
Java runtime problem
Reply to topic    Frihost Forum Index -> Computers -> Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.