0

what i'm trying to do is compile two java files but there is no way to accomplish that. I have the next two files.

file: Migration.java

package com.migratation;

import com.migration.Application;

public class Migration{
   public static void main(String[] args) {
       //code
   }
}

file: Application.java

package com.migration;

public class Application{
     //code
}

I have compiled and it generate two .class file.

javac *.java

But when i tried to run main java class it's failed and says

java Migration

Error: Could not find or load main class Migratation

kamboj
  • 411
  • 1
  • 9
  • 18
  • from which path are you running the Migration ??? – ΦXocę 웃 Пepeúpa ツ Nov 07 '16 at 18:10
  • 2
    `java` command expects full class name, not name of file. So try with `java com.migration.Migration`. You may also need to specify location of that (and possibly other) package in `-classpath` or `-cp` argument. – Pshemo Nov 07 '16 at 18:12
  • your first package is migratation while the second package is migration (typo in one of them, they must match) – blurfus Nov 07 '16 at 18:13
  • For now take a look at: http://stackoverflow.com/questions/18740468/how-to-compile-and-run-with-this-folder-structure/18740577#18740577. Will try to find better duplicate. – Pshemo Nov 07 '16 at 18:16

0 Answers0