Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

class with extend compile issue...

Posted on 2012-04-03
3
Medium Priority
?
398 Views
Last Modified: 2012-04-05
I have three classes in a folder. BookNew.java compiles fine.
ChildrenBook.java and TechnicalBook.java give the following error:

C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\begjsp-ch07x\WEB-
INF\classes\com\wrox\library>javac TechnicalBook.java
TechnicalBook.java:3: cannot resolve symbol
symbol  : class BookNew
location: class com.wrox.library.TechnicalBook
public class TechnicalBook extends BookNew {
                                   ^
1 error

Howver, when I inlculde BooNew.java in the same files as ChildrenBook.java and TechnicalBook.java (with public removed). they complile fine.

Question: How can I compile them saved in seperate files?
BookNew.java
ChildrenBook.java
TechnicalBook.java
0
Comment
Question by:Mike Eghtebas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 28

Expert Comment

by:rrz
ID: 37802489
I answered this in your last question.
http://www.experts-exchange.com/Programming/Languages/Java/J2EE/JSP/Q_27659256.html#a37799075   
use  
C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\begjsp-ch07x\WEB-INF\classes\com\wrox\library>javac  *.java
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 37802644
I ran and it works. There was a few thing my mind (with a litle ram) was busy with in the last question.

I guess this is the only way to do it. Does it has something to do with "package com.wrox.library;" line we are including here?

I have done many other times by

C:>...>ProkectFolder>javac SubClass.java

with SuperClass.java in the same folder.

Why worked then but it is not working here?

Mike
0
 
LVL 28

Accepted Solution

by:
rrz earned 2000 total points
ID: 37802984
>Why worked then but it is not working here?  
The compiler is looking for the package structure containing BookNew.class. Look at the beginning of  
http://www.experts-exchange.com/Programming/Languages/Java/J2EE/JSP/Q_27659256.html#a37799075 
See that I added
-cp "C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\begjsp-ch07\WEB-INF\classes"  
as an option.    
I suggest you learn the basics of Ant. It is really handy.
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Introduction to Processes
Starting up a Project

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question