• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compiling problem  RSS feed

 
dejie lin
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all
it will be quite messy if put all class in one file, so that i try to get some classes out and put them into different single files, for example, there's class Matrix in my ShowChart.java( main method inside ShowChart class), i wanna seperate Matrix from ShowChart.java, i did the following way:
1. create a new folder named as "ShowChart"
2. put ShowChart.java and Matrix.java into the folder
3. add " package ShowChart; " into the beginning of Matrix.java
4. add " package ShowChart; import ShowChart.*; " into the beginning of ShowChart.java
5. compile Matrix.java successfully
6. ........there are lots of error about "can't resolve symble Matrix....." after compiling ShowChart.java
....how can i fix it?
thanks for your helping
dejie
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you have class path issues... when you compile make sure the directory that contains the "ShowChart" directory is on the classpath... the easiest way to do this is go to that directory and type:

I'm moving this to Java In General (intermediate) since this doesn't involve JFC, Swing, or AWT directly...
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your ShowCart folder under. Whatever it is should be in the classpath.
For instance if you have:
C:\jdk1.3\ShowCart //holds the two java files
Then your classpath should include c:\jdk1.3 but NOT C:jdk1.3\ShowCart since the ShowCart subdirectory is to be a package under the classpath.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!