Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

school computer won't compile my code

 
Jesse Crockett
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I'm using a package statement that wont compile in the classroom. It compiles in the main student computer area but not on the actual classroom computer. It works fine at home, CLASSPATH=.;..;C...., and in the main student area. Is it a classpath problem on this particular computer? The control panel is locked, so I can't change the classpath..


 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well if it indeed is classpath problem you do not need access to the control panel to solve it.

You can redeclare the classpath variable from the command line:



If you are under windows I think it must be somewhat like...



...but you better check that

Another option is to use the -classpath option of the java.exe. Somewhat like this...



...under Linux use semicolons



I hope this helps!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also note that it is never necessary, or recommended, to import a class "A" in the same package as a class "B" -- i.e., you needn't "import package3.Inventory" in a class that declares "package package3".

Is "Inventory.java" in your "package3" directory?
 
Jesse Crockett
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I have no command line experience with the java compiler. I just put both classes in the same file under "package project3" and it worked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic