0

I'm want to execute a Java class through the terminal. When I execute it, I'll need several properties and configuration files that are on a folder X. That folder X has more subfolders with files inside them that I also need.

If I simply add the main file to the project in Eclipse as an External Class Folder, everything is in place.

With the terminal, I've tried: java -cp FOLDER_X MyClass.class

but that doesn't seem to manage to include the subfolder and what's inside them.

How should I do this?

1 Answers1

0

Your question is really broad, and you are not providing enough details, such as the package for MyClass.

Speaking of which, if MyClass is in the package com.test.MyClass then the java call should be:

java -cp FOLDER_X com.test.MyClass

Note that there's no ".class" at the end.

Alexandre Santos
  • 8,170
  • 10
  • 42
  • 64