Java import problem


 
Thread Tools Search this Thread
Top Forums Programming Java import problem
# 1  
Old 06-01-2010
Java import problem

In a default package, there are BankTest.java and package bank wich contains Account.class .

Code:
 // File: BankTest.java

import bank.*; 
 
public class BankTest { 
 
  public static void main(String[] args) 
  { 
    Account account; 
 
    ...
  } 
}

Trying to compile BankTest.java, terminal reports this error:

Code:
luke@luke-desktop:~/Desktop/Java/ex08/ex08_3$ javac BankTest.java
BankTest.java:14: cannot access bank.Account
bad class file: ./bank/Account.class
class file contains wrong class: Account
Please remove or make sure it appears in the correct subdirectory of the classpath.
    Account account;
    ^
1 error

What's the problem?

EDIT: I managed to solve the problem, there were some package declaration missing

Last edited by Luke Bonham; 06-01-2010 at 01:54 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Problem in import & expdp Dump file

Hi all, i face a problem on (oracle database) installed on server Linux i need to export back as dump file, when i try to export give me the below error. # expdp system/oracle directory=test dumpfile=Prodfb20150311.dmp logfile=Prodfb20150311.log FULL=y Export: Release 11.2.0.1.0 -... (2 Replies)
Discussion started by: clerck
2 Replies

2. Programming

Java 7 installation problem

Hi, I am trying to install java7.6 on redhat 6.2 but got the below error message. In fact this error comes up for all the supported OS of JDK 7 and JRE 7. I am running this as root and I dont have any other Java version installed. # rpm -i jre-7u6-linux-x64.rpm Unpacking JAR files... ... (5 Replies)
Discussion started by: nvk_vinoth
5 Replies

3. Programming

can i have an optimal solution for this java code ? Facing Java heap space problem even at 3GB heaps

My desired output is run: for this 1 for this 2 for this 3 for this 4 for this 5 for this 1,2 1->2 for this 2,3 2->3 for this 3,4 3->4 for this 4,5 4->5 for this 1,2,3 1->2,3 (2 Replies)
Discussion started by: vaibhavkorde
2 Replies

4. Shell Programming and Scripting

Mysql import problem

Dear folks, i am importing a database since yesterday that is innodb tablespace, the space of dump file is 4GB, almost 24 pass out it is not yet complete. What should i do to import it fastly. I have disable foreign key check because it have some issues so thats why i am importing it with source... (2 Replies)
Discussion started by: learnbash
2 Replies

5. Programming

Java sting up path problem

Hi java programmers I'm a newbee to the Java. Could please help me to set the path correctly. I'm getting the following error. ----jGRASP exec: javac -g C:\Documents and Settings\bogugk\Desktop\HelloWorldApp.java ----jGRASP wedge2 error: command "javac" not found. ---- This command... (1 Reply)
Discussion started by: repinementer
1 Replies

6. Shell Programming and Scripting

Problem with java in crontab

Hello everybody, I have made a java program which runs when i do : java telemesures But when i want to put it in a cron i do /j2sdk1.4.1/bin/java -cp :/web/WEB-INF/classes/Dany4/ telemesures i have got Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver ... (2 Replies)
Discussion started by: totollix
2 Replies

7. Shell Programming and Scripting

problem in java process

Hi, My operating system is centOS. I am running a java process on this os. But my process is killed automatically before completion. The timing of process killing is uncertain. Please help me. Thanks in advance, (0 Replies)
Discussion started by: Mrs. Deswal
0 Replies

8. OS X (Apple)

Java resousebundle problem

Hi Masters, I am runing a java application on Mac os x10.4, java version 1.5. I had this errors regarding chinese language issue. Could anyone have a hint? Thanks a ton. > java -classpath clinic.jar com.scsl.main.MyClinic Exception in thread "main" java.util.MissingResourceException: Can't... (0 Replies)
Discussion started by: mskcc
0 Replies

9. Shell Programming and Scripting

ksh script and java problem

I have a problem with the execution of a ksh as deamon on linux. I explain you first the context. We have developped a Java program that execute every minutes an external (that we don't have developped) program with a config file in parameter. The Java program is runned as deamon with a perl... (0 Replies)
Discussion started by: adrian.mihai
0 Replies

10. UNIX for Dummies Questions & Answers

Java vm problem

I am using Redhat 7.2. I am trying to install LimeWireLinux. I downloaded the latest versions of LimeWireLinux and JavaVM. I have been trough Limewire, and Sun's setup documents and have done the workarounds for any known problems. My problem is: I get the following error when tring to install the... (3 Replies)
Discussion started by: jeremiebarber
3 Replies
Login or Register to Ask a Question