The Artima Developer Community
Sponsored Link

Java Answers Forum
Want to compile class in a different folder

2 replies on 1 page. Most recent reply: Oct 17, 2002 6:03 PM by Sid Northfield

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Sid Northfield

Posts: 20
Nickname: northfield
Registered: Aug, 2002

Want to compile class in a different folder Posted: Oct 17, 2002 8:27 AM
Reply to this message Reply
Advertisement
I have classes in this directory structure:
C:\portalbean\portal

All classes in this folder are package as so:

package portal;
class PortalTest implements PortalReadWrite
{
...
}

I have tested the application on the command prompt as so:
C:\portalbean>java portal.PortalTest

This Works.
My problem is that I now want to move the PortalTest.java file to a folder called TestDrivers. This is because I want to have PortalTest2.java ...PortalTestN.java

So thus now PortalTest2.java is in a folder called:
C:\portalbean\portal\TestDrivers

import portal.*; //note this is the only line I have changed
class PortalTest2 implements PortalReadWrite
{
...
}

However the class does not compile. Gives errors such as:

C:\portalbean\portal>cd TestDrivers

C:\portalbean\portal\TestDrivers>javac *.java
PortalTest1.java:1: package portal does not exist
import portal.*;
^
PortalTest1.java:17: cannot resolve symbol
symbol : class PortalReadWrite
location: class PortalFtpTest
class PortalTest1 implements PortalReadWrite
^
PortalTest1.java:19: cannot resolve symbol
symbol : class PortalFtp
location: class PortalTest1
PortalFtp ftp;
^
PortalTest1.java:25: cannot resolve symbol
symbol : class PortalFtp
location: class PortalTest1
ftp = new PortalFtp();
^

Please help,


Don Hill

Posts: 70
Nickname: ssswdon
Registered: Jul, 2002

Re: Want to compile class in a different folder Posted: Oct 17, 2002 5:12 PM
Reply to this message Reply
try this,
javac -?
take a look at the -d

D:\projects\viaportal\feeds\war>javac -?
-? is an invalid option or argument.
Usage: javac <options> <source files>

where <options> includes:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-O Optimize; may hinder debugging or enlarge class files
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-target <release> Generate class files for specific VM version

HTH

Sid Northfield

Posts: 20
Nickname: northfield
Registered: Aug, 2002

Re: Want to compile class in a different folder Posted: Oct 17, 2002 6:03 PM
Reply to this message Reply
>try this,
javac -?

I have seen this many times.
I do not know what you want me to do?????????????????

Flat View: This topic has 2 replies on 1 page
Topic: what is the difference string and stringbuffer? Previous Topic   Next Topic Topic: appletviewer problems

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use