Package and CLASSPATH

Hi,
I have a hard time understanding the package and CLASSPATH. I want to have a solid understanding of it. I read some tutorials online but didn't make me fully understand. How does declaring a package effect the CLASSPATH? Say I have following:
(This is from one of the tutorial- http://home.cogeco.ca/~ve3ll/jatutor4.htm)
C:\myclasses\world\moon\HelloMoon.java
C:\myclasses\world\HelloWorld.java
HelloMoon.java is defined as
package world.moon;
public class HelloMoon {
private String holeName = "rabbit hole";
public String getHoleName() {
return holeName;
public void setHole(String holeName) {
this.holeName = holeName;
public static void main(String[] args){
     HelloMoon moon = new HelloMoon();
     System.out.println(moon.getHoleName());
HelloWorld is defined as
package world;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
if the CLASSPATH is set : set CLASSPATH=.;C:\myclasses;
Once the CLASSPATH has been set (and compiled .java file); it can be called using the following from any path of directory:
java world.HelloWorld
java world.moon.HelloMoon
But it does not explain the details why it works this way. Also, if I want to run it without using "world" prefix to run HelloWorld, what do I need to set up?
also for the HelloMoon?
When I tried running those classes by going to an appropriate directory, I got the noClassDefFound (using command like "java HelloWorld" or java "HelloMoon").
Thanks in advance...

[Javapedia: Classpath|http://wiki.java.net/bin/view/Javapedia/ClassPath]
[How Classes are Found|http://java.sun.com/j2se/1.5.0/docs/tooldocs/findingclasses.html]
[Setting the class path (Windows)|http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpath.html]
[Setting the class path (Solaris/Linux)|http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html]
[Understanding the Java ClassLoader|http://www-106.ibm.com/developerworks/edu/j-dw-javaclass-i.html]
java -cp .;<any other directories or jars> YourClassNameYou get a NoClassDefFoundError message because the JVM (Java Virtual Machine) can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.
javac -classpath .;<any additional jar files or directories> YourClassName.javaYou get a "cannot resolve symbol" message because the compiler can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

Similar Messages

  • How to set packages and classpath

    Hi,
    I want to know about packages and classpath. I have these questions
    1, If I put a class in a package(work.util) is it necessary to put the java file in the same directory/directory hierarchy as mentioned in the package declaration. I have to compile this class, run it from main method and must be able for other classes to import.
    2. If a package have subpackages(work.util.db) do I have to set the classpath to subdirectory also to run that class.
    3. If a class is in package is it possible to run the class without prefixing the package name. I need to do this in the text editor so that I can run any program by pressing a hot key.
    rgds
    Antony Paul

    1, If I put a class in a package(work.util) is it
    necessary to put the java file in the same
    directory/directory hierarchy as mentioned in the
    package declaration.Strictly speaking, this isn't covered by the spec - it depends on what compiler and ClassLoader you are using. If you're using Sun's JDK, then yes.
    2. If a package have subpackages(work.util.db) do I
    have to set the classpath to subdirectory also to run
    that class. No. You should add the directory above work/util/db to your classpath. You should not add work, or work/util or work/util/db.
    E.g., if your Java files are in C:/MyProject/JavaSrc/work/util/db, and the package name is work.util.db, then you should have C:/MyProject/JavaSrc on your classpath (or have "." (dot) on your classpath, and compile and run from that same directory).
    3. If a class is in package is it possible to run the
    class without prefixing the package name. I need to do
    this in the text editor so that I can run any program
    by pressing a hot key.If you mean "in order to run work.util.db.Main do I need to type java work.util.db.Main, or just java Main", then you do indeed need the fully qualified class name (otherwise, how would the runtime environment know which class you mean? - there could be any number of classes called Main in any class, and it would have to search every directory and subdirectory on your classpath to find them.

  • Adding packages and classpath

    Hi there all,
    Having finished by first Java application for work, I'm trying to create an executable jar file for it.
    The current directory structure is: -
    +---- programs
    |        |
    |        |---- GateKeeper
    |
    |---- commonfilesThe commonfiles directory contains the packages my program uses. I usually run the program via a batch file which is in the GateKeeper directory using: -
    C:\j2sdk1.4.2_04\bin\java -classpath .;h:\Java\commonfiles\ojdbc14.jar;h:\Java GateKeeper
    I have read the jar file tutorial and have created my jar file by using: -
    jar cf GateKeeper.jar programs commonfiles
    I'm now trying to set the Main-Class within the jar file. So I have tried this: -
    jar cmf Main-Class: programs/GateKeeper/GateKeeper GateKeeper.jar
    However, I keep getting this error: -
    H:\Java\JarTemp>jar cmf Main-Class: programs\GateKeeper\GateKeeper GateKeeper.jar
    java.io.FileNotFoundException: Main-Class: (The system cannot find the file spec
    ified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    at sun.tools.jar.Main.run(Main.java:123)
    at sun.tools.jar.Main.main(Main.java:904)
    H:\Java\JarTemp>
    This is my first time trying to deploy something that I've made, so a little patience wouldn't go amiss here. :) I also need to somehow add the commonfiles directory to the internal classpath of the jar file so that the application can find my packages (which used to happen by setting the classpath on execution).
    Thanks for any help.

    Heh.......this is turning into a bit of a running commentary. Perhaps I can sell the movie rights "Newbie: When Jars Go Bad". :)
    Anyway.....onward.
    Got the thing to execute (sort of) by just having commonfiles as a directory and the rest as seperate class files. I've got a text file containing the manifest (callded "manifest" now)
    Main-Class: GateKeeper
    Class-Path: commonfiles\ojdbc14.jar commonfiles .
    I've created the Jar file using: -
    jar cvmf manifest GateKeeper.jar commonfiles images GateKeeper.class GateKeeperFrame$1.class GateKeeperFrame$MainAction.class GateKeeperFrame$MainButtonListener.class GateKeeperFrame.class LoginFrame$DataSource.class LoginFrame.class UsersDataModel.class
    ...which is basically just a bunch of classes.
    I can now execute the Jar file using "java -jar GateKeeper.jar".....all well and good. However, I now get this error.: -
    Exception in thread "main" java.lang.NoSuchMethodError
    at GateKeeper.main(GateKeeper.java:25)
    ...which, in my "main" method is this line: -
    Point centreScreen = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
    Any particular reason that its barfing here? Remember I can run this application fine when its not jar'ed.

  • Help with packages and classpath

    Heya,
    first off, i use textpad to compile my java, i don't do it via the command line.
    my problem is faily simple, i think. i've got a main class and i'd like it to import a custom class from a subdir.
    Main class is in
    C:\Documents and Settings\David\Desktop\java\test_gen.java
    I would like it to import
    C:\Documents and Settings\David\Desktop\java\obj_data\objects.java
    I understand that I have to declare objects.java to be a part of a package, so i head the code with: package obj_data; as i understand it, the directory in which the package to be imported resides in will be named the same as the package.
    When i import my package into test_gen.java, i import obj_data as follows:
    import obj_data.*;
    this should import objects.class and any other classes in the same directory. also import obj_data.objects.*; could be used.
    Anyway, thats my understanding of how you set up the class and package; i also understand that when the java file compiles the compiler looks at the directoy(s) indicated in the class path for the classes to import. that in mind i tried to add:
    C:\Documents and Settings\David\Desktop\java\obj_data\
    to my classpath. i did this via dos, javac -classpath "C:\Documents and Settings\David\Desktop\java\obj_data\"
    i got no error messages, so i assume it worked. however when i try to compile the main java (test_gen) i get-
    package packages does not exist
    import packages.*;
    ^
    1 error
    Tool completed with exit code 1
    can anyone give me some help please?

    This is a minimal explanation of packages.
    Assume that your programs are part of a package named myapp, which is specified by this first line in each source file:
    package myapp;
    Also assume that directory (C:\java\work\) is listed in the CLASSPATH list of directories.
    Also assume that all your source files reside in this directory structure: C:\java\work\myapp\
    Then a statement to compile your source file named aProgram.java is:
    C:\java\work\>javac myapp\aProgram.java
    Explanation:
    Compiling
    A class is in a package if there is a package statement at the top of the class.
    The source file needs to be in a subdirectory structure. The subdirectory structure must match the package statement. The top subdirectory must be in the classpath directory.
    So, you generate a directory structure C:\java\work\myapp\ which is the [classpath directory + the package subdirectory structure], and place aProgram.java in it.
    Then from the classpath directory (C:\java\work\) use the command: javac myapp\aProgram.java
    Running
    Compiling creates a file, aProgram.class in the myapp directory.
    (The following is where people tend to get lost.)
    The correct name now, as far as java is concerned, is the combination of package name and class name: myapp.aProgram (note I omit the .class) If you don't use this name, java will complain that it can't find the class.
    To run a class that's NOT part of a package, you use the command: java SomeFile (assuming that SomeFile.class is in a directory that's listed in the classpath)
    To run a class that IS part of a package, you use the command java myapp.aProgram (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)

  • How to create package and import from jar file?

    Hi all,
    I am writing a software and I am not sure how to create a package for the classes.
    Say I have two classes in the same directory as follows:
    testA.java
    ==========
    package AB;
    public class testA
    public static void main(String[] args){
         testB myB = new testB();
         System.out.println("A test");
    testB.java
    ===========
    package AB;
    public class testB
    public testB(){
         System.out.println("B constructor");
    both file compile without the package heading;
    both file compile using: javac -classpath .\ *.java
    Question 1:
    I cannot run testA by: java -classpath .\ testA
    I think it is a syntax error. What is the correct one?
    If I run testA by: java testA
    The only output I get is: A test
    But I am expecting: B constructor /n A test
    What went wrong?
    Question 2:
    I need to use APIs of another software. I have downloaded a .jar file (xxx.jar) with all the classes in it. And I have put "import xxx.*;" in my source file. But the compiler complains about the importing. What is the right way to copmile it?
    I have read a couple of tutorials but they don't answer my question.
    (I am using windows2000 and don't have the classpath variable.)
    Hope some one can help.
    Thanks a lot

    Try moving testA out of the package and importing 'AB.*;'
    If you have:
    ./testA.class
    ./AB/testb.class
    Then to execute testA from ./ type: java -cp . testA

  • How to create a package and add a file?

    Hi all,
    I am new to Java and very much much confussed with how to create a package and then include some files any help will be very thankfull.
    Thanks for your help
    kka.

    Steps for creating a package in java are as follows:
    Choose a base directory for your classes. For example, you might choose c:\java\packages. Type the following command:
    set CLASSPATH=%CLASSPATH%;c:\java\packages
    Create subdirectories for each chapter or section, if you don't already have them.
    For each of the classes in the subdirectories, add the following line to the very top of each file:
    package directory-name;
    where directory-name is the name of the subdirectory the class file is located in.
    In other directories you may have class files that need to access one of the classes in another directory (package). To do this, write one of the following at the top of the class that needs the other class:
    import subdir.*;
    or
    import subdir.classname;
    Use the class by name in the new class file.
    Note that you can create sub-packages by creating subdirectories of the original subdirectories, and inserting package statements at the top of the java files in those directories.
    Hope this helps!

  • Ears, wars, support jars, and CLASSPATH

    I am trying to migrate an application from WLS 5.1 to 6.1. There are 25
    EJB jars with an equal number of support jars, most of which are referenced
    by multiple EJBs. There are also a large number of jsps, and html pages.
    I have tried packaging an ear that contains the 25 ejb jars, a war file
    containing the web pages. I have attempted to include the support jars in
    the ear as well.
    In all attempts, the only way I get class references sastisfied is to
    include all the jars on the system CLASSPATH. But this defeats the purpose
    of packaging, since none of the components referenced in the system
    CLASSPATH will be re-deployable.
    The online documents refer to separate class loaders and classpaths for the
    war and ejbs, but no detail as to how classes are found by the loaders.
    Unless I put all the jars into the CLASSPATH, jsp pages cannot reference the
    EJBs, and EJBs are unable to reference other EJBs.

    Thanks,
    Now if I could just get Webgain Visual Cafe to allow me to include the
    Classpath entries in the generated manifests for the EJB jars.
    "Gregory Gerard" <[email protected]> wrote in message
    news:3ba24da1$[email protected]..
    You need to mangle all the Manifest files within the EAR and EJB-JARs and
    WAR to get the right thing to happen. Check out this PDF on Sun's site:
    http://java.sun.com/j2ee/j2ee-1_3-pfd4-spec.pdf
    section 8.1.1.2
    I don't entirely understand all the restrictions and formatting -- Ihaven't
    found an example ear file out there that implements a non-trivial case.
    greg
    "Carl Lawstuen" <[email protected]> wrote in message
    news:3ba21d8e$[email protected]..
    I am trying to migrate an application from WLS 5.1 to 6.1. There are
    25
    EJB jars with an equal number of support jars, most of which arereferenced
    by multiple EJBs. There are also a large number of jsps, and htmlpages.
    I have tried packaging an ear that contains the 25 ejb jars, a war file
    containing the web pages. I have attempted to include the support jarsin
    the ear as well.
    In all attempts, the only way I get class references sastisfied is to
    include all the jars on the system CLASSPATH. But this defeats thepurpose
    of packaging, since none of the components referenced in the system
    CLASSPATH will be re-deployable.
    The online documents refer to separate class loaders and classpaths forthe
    war and ejbs, but no detail as to how classes are found by the loaders.
    Unless I put all the jars into the CLASSPATH, jsp pages cannot referencethe
    EJBs, and EJBs are unable to reference other EJBs.

  • Split Directory Packaging and Deployment Question

    Hello Rob Woollen and All,
    I have a question about packaging and deployment with the "split directory structure"
    in WebLogic Server 8.1.
    Specifically, how does one go about deciding which classes to put in myEnterpriseApp/myWebApp/WEB-INF/classes,
    versus myEnterpriseApp/myEjbModule, versus myEnterpriseApp/APP-INF/classes?
    I think the answer to the first part is easy enough: if there are classes depended
    on by, say, the servlets in a web app, but not depended on anywhere else in the
    enterprise app, then those classes should go in WEB-INF/classes.
    It's the other part of the question that gives me trouble. I use local interfaces
    on my session beans. Let's say I have a domain object class returned from a session
    bean method and depended on by the web app. If I put that domain object class
    under myEnterpriseApp/myEjbModule, then the web app can see it by virtue of the
    classloader arrangement.
    But the wlcompile Ant target supposedly compiles stuff to build/APP-INF/classes.
    What stuff? How does it decide? I haven't experimented and empirically observed
    yet, but I couldn't find the answer in the documentation and tutorials. Is it
    looking for java source files under src/myEnterpriseApp but not under myWebApp
    or myEjbModule? In general, does BEA have any recommendations in this area?
    Thanks,
    Randy

    "Randy Stafford" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi Mark,
    Thanks for the reply. I don't have 8.1 installed yet, so I can'tempirically
    observe the example's behavior. But I downloaded the example andinspected the
    code. It answers some, but not all, of my questions.Where to start.
    In 8.1 we have made optimizations to J2EE packaging. Mostly this is about
    not having to use manifest classpath's to do sharing of of common classes.
    MF Cp's are a pain to configure. You put your classes in one location in
    the ear and then EVERY module has to have a MF CP entry pointing to that
    location, and then you actually have N number of classes loaded per module.
    The mechanism to share classes across all modules is APP-INF/lib and
    APP-INF/classes. The benefit is that APP-INF is shared across all modules.
    So to your question below you could just put it in the EJB module, BUT if
    you have mutliple EJBs that you split into seperate modules your back tot
    the same issue. So APP-INF is just the simplist solution over-all.
    Split-dir is a specified way to lay out disk your src files
    Split-dir
    From code inspection, it looks like the JSP and EJB (therefore the web appmodule
    and EJB module) both depend on the AppUtils class, which is not inAPP-INF, but
    rather in a directory under the enterprise app directory that does notrepresent
    a web app module or EJB module. In the build file's compile target, is itthe
    wlcompile task invocation that causes compilation of AppUtils.java? Or isit
    the ant task invocation (with "build.appStartup" as the value of thetarget attribute)
    that causes compilation of AppUtils.java due to the dependency ofApplicationStartup
    on AppUtils? And what subdirectory of the build directory doesAppUtils.class
    end up in?
    Why not just put AppUtils.java in the EJB module? Both dependent moduleswould
    still be able to see it by virtue of the classloader arrangement. Doesputting
    it in outside of all dependent modules represent a convention that BEArecommends?
    >
    Finally, why not put applicationresource.properties in the same place asits user
    AppUtils.java?
    Thanks,
    Randy
    "Mark Griffith" <[email protected]> wrote:
    Randy:
    (Rob may post later, but here is my take)
    "Randy Stafford" <[email protected]> wrote in message
    news:[email protected]...
    Hello Rob Woollen and All,
    I have a question about packaging and deployment with the "split
    directory
    structure"
    in WebLogic Server 8.1.
    Specifically, how does one go about deciding which classes to put inmyEnterpriseApp/myWebApp/WEB-INF/classes,
    versus myEnterpriseApp/myEjbModule, versusmyEnterpriseApp/APP-INF/classes?
    I think the answer to the first part is easy enough: if there are
    classes
    depended
    on by, say, the servlets in a web app, but not depended on anywhereelse
    in the
    enterprise app, then those classes should go in WEB-INF/classes.
    It's the other part of the question that gives me trouble. I use localinterfaces
    on my session beans. Let's say I have a domain object class returnedfrom
    a session
    bean method and depended on by the web app. If I put that domain
    object
    class
    under myEnterpriseApp/myEjbModule, then the web app can see it by
    virtue
    of the
    classloader arrangement.
    But the wlcompile Ant target supposedly compiles stuff tobuild/APP-INF/classes.
    What stuff? How does it decide?wlcompile has a module factory. If a directory is claimed by a module
    factory then it is compiled by that specific module compiler. The rules
    for
    module definition follow the same J2EE formatting rules.
    So:
    /myejb/
    would be identified as a ebj module by:
    */myejb/meta-inf/ejb-jar.xml
    */myejb/myejb.ejb (EJBGen file)
    then src files (*.java) will be compiled to
    $BUILD_DIR/myejb/
    /myweb/
    would be identifid as a web module by:
    */myweb/WEB-INF/web.xml
    Also for webapps
    /myweb/WEB-INF/src/*.java
    will be compiled ot
    $BUILD_DIR/myweb/WEB-INF/classes
    We choose WEB-INF/src following the struts precedence.
    So a plain old module that has noting but .java files in it will go to
    $BUILD_DIR/APP-INF/classes
    If you have a jar of classes that you need to share across the entire
    ear,
    you would check it into your src tree at:
    $SRC_DIR/APP-INF/lib/mycommon.jar
    You can check out an example at:
    $BEA_HOME/weblogic81/samples/server/examples/src/examples/splitdir/helloWorl
    dEar
    Hope this helps.
    cheers
    mbg
    I haven't experimented and empirically observed
    yet, but I couldn't find the answer in the documentation and tutorials.Is it
    looking for java source files under src/myEnterpriseApp but not undermyWebApp
    or myEjbModule? In general, does BEA have any recommendations in thisarea?
    Thanks,
    Randy

  • Packaging and Different Directories

    Hi there,
    I am trying to build an application that will store plugins in a separate directory to the main program. For example, if the main program is at c:/myapp then the plugins are at c:/myapp/plugins . The plugins are also java files.
    I want to be able to access these plugins to use them in my program - is there any way this can be done WITHOUT modifying the classpath?
    This is on a similar note, but I have tried to package the plugins up into a plugins package and then access it, however I get issues trying to talk between files in the same package (example, 2 plugins talking to each other). How can I get package files to talk to each other when they both co-exist in the exact same package. Shouldn't this already be acceptable communication if I have .; in my classpath?
    Thank you for your efforts, I know I keep bringing up the hard questions :)
    WATTO

    OK, here comes the questions... :)
    I have successfully been able to load class files from a different directory using the URLClassLoader, however when it loads it complains that it can't access a variable in the superclass. The Superclass is another class that I have made, which is located in the main program directory, but it is not in the same directory as the plugin. So, this tells me that it has loaded the plugin class using a separate classpath to that used by the program, otherwise it would have been easily able to find the superclass.
    So, I have tried copying/moving the superclass into the same directory as the plugin, but still it says that it is unable to access the superclass.
    The way I have been working this so far is that I compile the plugin in the main program directory, so that the superclass and other relationships are preserver, and then move the plugin class file into the plugins directory.
    Can anyone offer any suggestions as to why this would not be working. Does anyone know how the URLClassLoader uses the classpath of the program? Basically, why is it not finding my superclass even if the superclass is in the same directory as the class I am loading, and how can I solve the problem?
    Just to clarify, it IS finding the plugin, so I'm not getting those ClassNotFound exceptions.
    Thanks for any help you can provide.
    WATTO

  • J2EE Packaging and manifest Class-Path:

    Does anyone know if Weblogic 6.0 supports the redefined deployment extension mechanism
    that makes use of the 'Class-Path:' entry in the manifest files?
    In our project we have one single .ear file containing a couple of EJB's (.jar
    files) and a Web Application (.war file).
    We are using log4j as logging mechanism and we would like to keep everything in
    the .ear file so that we can make hot-deploys. So we are trying not to make use
    of the classpath in startWebLogic.sh. All of our EJB's and the Web Application
    makes use of log4j.jar. My question is; can I do the following and make it work
    in Weblogic 6.0?
    1. In every EJB .jar file I add the follwing to the manifest file - "Class-Path:
    log4j.jar"
    2. I place the log4j.jar in the root directory of the .ear file.
    By doing this I expect that the ear classloader loads the log4j.jar classes. Am
    I right or do I do something wrong. At least it does not seem to work.
    Using Weblogic 6.0 without service pack.
    Thanks,
    Steen

    This does not work in WebLogic 6.0. It's supposed to be supported in 6.1
    Daniel
    -----Original Message-----
    From: Steen Laursen [mailto:[email protected]]
    Posted At: Wednesday, August 08, 2001 1:32 PM
    Posted To: environment
    Conversation: J2EE Packaging and manifest Class-Path:
    Subject: J2EE Packaging and manifest Class-Path:
    Does anyone know if Weblogic 6.0 supports the redefined
    deployment extension mechanism
    that makes use of the 'Class-Path:' entry in the manifest files?
    In our project we have one single .ear file containing a
    couple of EJB's (.jar
    files) and a Web Application (.war file).
    We are using log4j as logging mechanism and we would like to
    keep everything in
    the .ear file so that we can make hot-deploys. So we are
    trying not to make use
    of the classpath in startWebLogic.sh. All of our EJB's and
    the Web Application
    makes use of log4j.jar. My question is; can I do the
    following and make it work
    in Weblogic 6.0?
    1. In every EJB .jar file I add the follwing to the manifest
    file - "Class-Path:
    log4j.jar"
    2. I place the log4j.jar in the root directory of the .ear file.
    By doing this I expect that the ear classloader loads the
    log4j.jar classes. Am
    I right or do I do something wrong. At least it does not seem
    to work.
    Using Weblogic 6.0 without service pack.
    Thanks,
    Steen

  • Packages..CLASSPATH ?!!

    HI,
    I'm quite a newbie to Java.Could anyone give me any link to a web page that gives me a detailed explanation on Packages and the Classpath environment variable.
    I'm getting some compile-time errors while working with Packages (probably because the classpath isn't configured properly).

    I found a good discussion by searching at the javaranch.com site. As a newbie also I found that the key point about packages was in the practical application -- when you compile a package you have to compile from the parent directory, not the directory which constitutes the package. So the statement at the command line is:
    javac .\<package_name>\<src_files>
    Then to run the app, if your class has a main method:
    java <package_name>.<class_name>
    Hope this helps.

  • Packaging and installing a java project

    Hi everyone,
    I have a java project which has been developed in Eclipse IDE. I would like to package the project so that i it can be installed and can be run as a stand alone product.
    Any tools that would help me do packaging and installing a java project?
    Thank you.

    Easiest way to package a Java project is to create an executable jar for it. You probably should google for more information on the 'jar.exe' program (sry for window bias)
    If you have external dependencies you should put those in separate jars and include them in the classpath in the jar manifest file.
    The only other thing to worry about is getting java installed on other people's machines. In general it is best if possible to have them download java themselves as they will get the latest and greatest from this website. If that's not possible you may want to look into getting sun's permission to distribute Java with your app.

  • Need ant script to compile, package, and deploy to Oracle AS 10.3.1

    I have a test app with ADF faces/jsf for front-end and EJB 3.0 Session Facade/Entity beans for back-end. The project structure/layout is similar to the SRDEMO app in JDeveloper. I was able to compile, package, and deploy within JDeveloper 10g to Oracle AS 10g successfully. Is there a sample ant script to compile, package, and deploy to Oracle AS 10g that I can run from command line? The build.xml that came with SRDEMO only do the compilation, not packaging and deployment. I was able to modify the SRDEMO's build.xml to compile my test app though. I still need the script to package and deploy it.
    Thanks,

    Hi,
    How are you referring to the class path. I have created my custom build file and I refer like this.
    <path id="classpath">
      <pathelement location="${oracle.home}/lib/aia.jar"/>
      <pathelement location="${oracle.common.home}/modules/org.apache.commons.logging_1.0.4.jar"/>
    </path> oracle.home is the location where my aia.jar resides.
    In the compile-classes target I have
    <!--Target for Class path details -->
    <target name="compile-classes">
      <mkdir dir="${sca-inf.classes.dir}"/>
      <javac destdir="${sca-inf.classes.dir}"   classpathref="classpath"
             debug="on"                         nowarn="${javac.nowarn}"
             deprecation="${javac.deprecation}" encoding="Cp1252"
             source="1.6"                       target="1.6">
        <src path="${src.dir}"/>
      </javac> 
    </target> Regards,
    Neeraj Sehgal

  • [NOTE] bpelx:exec and classpath

    ===============================
    QUESTION
    ===============================
    We have been receiving a lot of emails lately about the use of Java embedding and classpath information.
    ===============================
    ANSWER
    ===============================
    The answer is that any classes used in the inlined <bpelx:exec> code snippet needs to be either in the global classpath or preferably packaged in the BPEL-INF\classes or BPEL-INF\jar section of the BPEL suitcase (pattern which is very similar to how .war archives work).
    For more information please refer to:
    1) C:\orabpel\samples\references\JavaExec
    2) C:\orabpel\samples\demos\LoanDemoPlus\LoanFlowPlus
    Both examples uses an ant script to compile the dependent classes into <bpel project folder>\BPEL-INF\classes.
    Like for .war archives, there are more sophisticated options offers by bpelc to just in time copy .jars into the BPEL-INF\lib folder of the generated war.
    I hope that this note will address so of the questions people have in this area until we build out our documentation.
    Edwin

    how about writing the path in the <applet codebase="path"> attrib?

  • Difference between path and classpath

    Difference between path and classpath?

    PATH - set of paths there executables will be found.
    CLASSPATH - set of paths and archives there class files will be found.

Maybe you are looking for

  • Can't add mp3s to iTunes libaray

    Hi, I've been having various issues with my iTunes library and duplicate tracks, so I decided to wipe everything and start fresh. Before I uninstalled, I was having problems adding songs to my library. I don't typically store the songs in my library,

  • Can I stream hbo go from iphone to apple tv

    I want to know if I can view hbo go app from iphone and have it stream to my apple tv?    I tried to use the hdmi plug adapter to plug into tv and the app won't support it, so I thought maybe I can stream it.  Does anyone know?

  • Adobe Acrobat 6-Compatibility Issues Message

    Does anyone know why when I try opening Adobe Acrobat 6 that I get "This program has known compatibility issues" message? That is as far as I can get opening acrobat. When I press run program, the adobe reader opens instead. Thanks for your help.

  • Problem Occured When assigning Provider system to service Group

    hi, Im trying to invoke external webservice into webdypro project(CE 7.1 ehp1) using Adaptive Webservice model. -->I created Service group for that webdynpro application. -->I created Provider system.(it is in active state only). -->when im trying to

  • Itunes insists on reorganising a series of talks by track number into groups so destroying the cd order

    I have a 5 cd set with tracks numbered 1-16 on each cd. Itunes insists on grouping all same track numbers together,so destroying the overall sequnce of the talks. How can I get it to leave the integrity of the cds alone?