简体   繁体   中英

Having trouble running Java program with Command Prompt

I'm getting the error Error: Could not find or load main class ExcelFileEditor when trying to run my program. I compiled the program with no errors by:

javac -cp C:\Users\rperera\IdeaProjects\LinkingNames\libs\*;. C:\Users\rperera\IdeaProjects\LinkingNames\src\ExcelFileEditor.java

I tried doing:

java ExcelFileEditor

java -cp C:\Users\rperera\IdeaProjects\LinkingNames\libs\* ExcelFileEditor

but I keep getting the same error. I'd really appreciate it if someone could help me fix this problem!

public static void main(String[] args) {
    //this allows the Py4J module in Python to use whichever methods it needs from this class
    ExcelFileEditor editor = new ExcelFileEditor(new File(args[0]));
    GatewayServer server = new GatewayServer(editor);
    server.start();
}

The package is excel.writer

If you are not specifying where to place the generated class files then its going to be in the same directory as the source file. Try

java -classpath C:\\Users\\rperera\\IdeaProjects\\LinkingNames\\libs\\*;C:\\Users\\rperera\\IdeaProjects\\Li‌​nkingNames\\src excel.writer.ExcelFileEditor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM