Hello

I've made a program using JCreator. It was working fine and all of a sudden it won't run anymore. I get this message:

--------------------Configuration: <Default>--------------------
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -client   to select the "client" VM
    -server   to select the "server" VM
    -hotspot      is a synonym for the "client" VM  [deprecated]
                  The default VM is client.
                  
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose[:class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image

It happens in the output window in JCreator and in the CMD window.

If I copy the whole code and paste it into a new file, with a new name, it works.

Any ideas why? Or what I need to do to solve it? I wonder if it is because the code is around 28,000 lines? I'm now working to cut this huge number down.

Thanks guys.

Well here is a hint: type "java" on your cmd...you should get that very same message. As for the size of the file I can tell you that that could be the problem, about a year ago I was writing a program that used three massive arrays and I had them all in the same class, when I went to compile that class, I got a huge error, well the solution was to put each array in its own class.

I have reduced the amount of code by using for loops instead of re-pasting each part. Now the program is less than 15,000 lines and I don't have the problem anymore!

Thanks Zetlin, for your input.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.