1 Reply Latest reply: Dec 27, 2009 9:27 PM by 800560 RSS

    Class compiles in Eclipse IDE just fine but when done in cmd line does not.

    843810
      Alright, so I have this class, which is posted below. When I compile it via Eclipse(by running another program that instantiates it), it works fine, and indeed, it only accesses objects in it's own package, BHEngine, and these classes are public. Heck, I thought nothing was wrong with it because Eclipse never had any problems with it.

      Today, I tried to compile this same class from the command line (Running a Mac OS so using Darwin) and I get the error list which will be shown after the class.


           
      package BHEngine;
      import userscripts.player1.*;
      import BattlehardFunctions.*;
      import java.io.FileWriter;
      import java.io.IOException;
      import java.util.ArrayList;
      public class PlayerScript implements Runnable {     
           Player player;          
           Thread t;
           public PlayerScript(Player player) {          
                this.player = player;                    
                 t = new Thread(this);          
                
                
                t.start();     }     
           public void run() {          
                for(;;) {
                
           
                try {               t.wait(1000); } catch(InterruptedException exc) { System.out.println("Error."); }          
                     String hobojeebies[];          
                     
                     do {     
                          hobojeebies = GodGenerator.returnStringArrayFromFile("/users/arkavon/documents/programs/workspace/BattlehardAIWars/db/" + player.username + "/script.txt");     
                          } while(hobojeebies[0].equals("load again"));               
                     if(hobojeebies[0].equals("load Revelations")) {               
                          BattlehardFunctions bf = new BattlehardFunctions(player.God,player);          
                          Revelations R = new Revelations(bf);               
                          
                          try {               FileWriter fw = new FileWriter("/users/arkavon/documents/programs/workspace/BattlehardAIWars/db/" + player.username + "/script.txt");               fw.write("loaded.");               fw.close(); 
                          } catch (IOException exc) { }
                          
                     }     }
                }
           }
      Here are the errors:

      Script.java:2: package userscripts.player1 does not exist
      import userscripts.player1.*;
      ^
      /users/arkavon/documents/programs/workspace/BattlehardAIWars/src/BHEngine/PlayerScript.java:3: package BattlehardFunctions does not exist
      import BattlehardFunctions.*;
      ^
      /users/arkavon/documents/programs/workspace/BattlehardAIWars/src/BHEngine/PlayerScript.java:8: cannot find symbol
      symbol : class Player
      location: class BHEngine.PlayerScript
           Player player;          
      ^
      /users/arkavon/documents/programs/workspace/BattlehardAIWars/src/BHEngine/PlayerScript.java:10: cannot find symbol
      symbol : class Player
      location: class BHEngine.PlayerScript
           public PlayerScript(Player player) {          
      ^
      /users/arkavon/documents/programs/workspace/BattlehardAIWars/src/BHEngine/PlayerScript.java:38: cannot find symbol
      symbol : variable GodGenerator
      location: class BHEngine.PlayerScript
                          hobojeebies = GodGenerator.returnStringArrayFromFile("/users/arkavon/documents/programs/workspace/BattlehardAIWars/db/" + player.username + "/script.txt");     
      ^
      /users/arkavon/documents/programs/workspace/BattlehardAIWars/src/BHEngine/PlayerScript.java:41: cannot find symbol
      symbol : class BattlehardFunctions
      location: class BHEngine.PlayerScript
                          BattlehardFunctions bf = new BattlehardFunctions(player.God,player);          
      ^
      /users/arkavon/documents/programs/workspace/BattlehardAIWars/src/BHEngine/PlayerScript.java:41: cannot find symbol
      symbol : class BattlehardFunctions
      location: class BHEngine.PlayerScript
                          BattlehardFunctions bf = new BattlehardFunctions(player.God,player);          
      ^
      /users/arkavon/documents/programs/workspace/BattlehardAIWars/src/BHEngine/PlayerScript.java:42: cannot find symbol
      symbol : class Revelations
      location: class BHEngine.PlayerScript
                          Revelations R = new Revelations(bf);          
      ^
      /users/arkavon/documents/programs/workspace/BattlehardAIWars/src/BHEngine/PlayerScript.java:42: cannot find symbol
      symbol : class Revelations
      location: class BHEngine.PlayerScript
                          Revelations R = new Revelations(bf);     

      So I am wondering why one compiler doesn't realize I have imported the correct packages and the other does? What's wrong here?

      Thank you!