Java command line call, change the current path, program running error

Source: Internet
Author: User

Your Own SourceProgramIs in F:/parser/parserdemo. Java,

Use the command line: javac-classpath stanford-parser.jar;. parserdemo. Java compilation,

Command Line: Java-CP stanford-parser.jar;. parser run

No problem.

 

But when I use the command line (Java-CP stanford-parser.jar;. parser) in the C ++ program to call the change program, it will go wrong. Tip: Java. Lang. noclassdeffounderror :...

 

 

Later I found that an error occurred when changing the current path of the command line. I guessSource codeThere are not many paths. Add a path

Java-cp f: // parser // stanford-parser.jar;F: // parser;Parserdemo

Try again.

 

Note: If a relative file is used in the program, such as aaa.txt, which is in the F:/parser directory, when you run the program from the command line, if the current path is not F:/parser, an error will be reported, the system prompts that the file cannot be found, so it is best to use the absolute path to call the program elsewhere.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.