My source files are in this folder: c:\data\mycompany. All of my source files contain the following as the first line: package mycompany; Now from the c:\data folder, I compiled everything using this command: javac mycompany/*.java -extdirs c:\some\other\folder\with\libs. This compiles fine. Now when I try to execute it (again from c:\data) using this command: java mycompany/test then i get this error:
Exception in thread "main"
java.lang.NoClassDefFoundError:
mycompany/test Caused by:
java.lang.ClassNotFoundException:
mycompany.test at java.net.URLClassLoader$1.run(Unknown Source)
I also tried the below command but it reproduces the same error:
java mycompany/test -extdirs c:\some\other\folder\with\libs
Is this the proper way to compile/run?
Here is my source-code:
package MyCompany;
public class Test
{
public static void main(String[] args)
{
System.out.println("test");
}
}