Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 3rd, 2004, 12:52 PM
Authorized User
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compiling Related java files

If I have to classes that reference each other, how would I get them both to compile?
I have ProgramA.java that belongs to package com.neopost.projectA and has a Protected Object reference to com.neopost.projectA.ProgramB.

Inside ProgramB.java that belongs to package com.neopost.projectA, there is a Private Object reference to com.neopost.projectA.ProgramA.

When I try to compile ProgramA.java I get "ProgramB.class not found" or "Symbol not recognized" errors, because ProgramB.class does not exist yet. So I try to compile ProgramB.java, and I get "ProgramA.class not found" or the same Symbol not recognized error.

How do I get these programs compiled?
 
Old August 4th, 2004, 03:45 AM
Registered User
 
Join Date: Aug 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If both the classes are in the same package.

go to <dir>/com/neopost/projectA> and give javac *.java

Quote:
quote:Originally posted by Jstmehr4u3
 If I have to classes that reference each other, how would I get them both to compile?
I have ProgramA.java that belongs to package com.neopost.projectA and has a Protected Object reference to com.neopost.projectA.ProgramB.

Inside ProgramB.java that belongs to package com.neopost.projectA, there is a Private Object reference to com.neopost.projectA.ProgramA.

When I try to compile ProgramA.java I get "ProgramB.class not found" or "Symbol not recognized" errors, because ProgramB.class does not exist yet. So I try to compile ProgramB.java, and I get "ProgramA.class not found" or the same Symbol not recognized error.

How do I get these programs compiled?

 
Old August 9th, 2004, 07:18 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

If it is across the package folders

use the import statement import com.neopost.projectA.*; // in projectB folder vice versa








Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling JAVA code in .NET? sivavenugopal BOOK: Beginning ASP.NET 1.0 1 January 24th, 2007 01:52 AM
help with compiling include files mastrgamr C++ Programming 3 December 14th, 2006 07:58 AM
Problem with the speed of compiling java programs sharadagarwal BOOK: Beginning Java 2 4 February 21st, 2004 02:40 PM
ch 12 compiling com\wrox\secure\*.java classes JHvdSloot JSP Basics 3 September 23rd, 2003 07:42 AM
New to Java, problems compiling Kyle Colyer JSP Basics 3 September 6th, 2003 04:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.