Setting classpath and creating packages

Hi
I am new to Java and my questions are basic.
1)I am using the kawa IDE and i dont know how to create and use packages.
2)Creating classpath to compile and run java programs from the Dos prompt.
I would appreciate any help on these questions

I'm not sure how to use KAWA.
When it comes to classpaths, though, I would recommend not setting it as an environment variable - this tends to cause confusion if you work on more than one project at a time on your machine. Either set it locally or specify it directly on the command line.
Often it's a good idea to write a batch file for compiling and executing your code:
setlocal
set PATH=c:\j2sdk-1.3
set CLASSPATH=c:\jars\Servlet.jar
javac MyClass.java
endlocalHope this helps.

Similar Messages

  • How to set classpath and server configuration in eclipse

    i am new to eclipse tool pls anyone tell me to set classpath and serverconfiguration (tomcat) and sample program

    Get WTP [1], install it [2] and checkout one of the lot Eclipse WTP tutorials [3].
    [1] http://www.eclipse.org/webtools/
    [2] http://ftp.osuosl.org/pub/eclipse/technology/phoenix/demos/install-wtp/install-wtp.html
    [3] http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html

  • Setting Classpath and Path on Windows ME

    Hi..How do I set up the classpath and path on windows ME. Do I use DOS or run the autoexec.bat from windows directly. I have jdk1.3.1 abd my classpath and path are:
    set classpath="C:\jdk1.3.1\bin"
    set PATH=C:\windows\xxxx\;C:\jdk1.3.1\bin
    I sometimes can't compile my programs from other directories other than jdk1.3.1\bin. Why? Is there a way I can compile my program just from the C:\ directory like:
    C:\javac myprogram.java
    C:\java myprogram
    Thanks.

    If you put . in the beginning of your classpath, java always searches the folder you are currently in.
    Now to set the classpath try clicking from the startmenu:
    settings/control panel/system. Then click advanced tab and then the Enviroment variables. I'm on win2000 but I think it should be the same on ME.
    Make sure it starts with .;C:\jdk1.3.1\bin;....
    I think installing jdk puts in the essentials, but if you have certain folders you store your classes in you can stick those in there as well.
    If you hava more questions about this, I suggest searching these forums on Keywords like : "set CLASSPATH PATH". Then you'll find a bunch of threads solving this problem.
    Sjur

  • Setting classpath and library path...

    hello..
    i have downloaded the jfreechart1.0.4 for adding chart in my java application...though i have gone through the installation guide...but i havent figured it out how to make the packages available to my java application....
    i am very new to java ....so pls suggest me any way to make those packages available to my java which is in my j2sdk\bin folder...and truly i dont have any idea where to set the lib path and class path....so pls post any suggestion or any url that will help me...

    Hi,
    You should not place files in the bin directory of your JDK/JRE. Just place the jar-files somewhere close to your application, e.g. in a lib folder in your project folder. Then set the classpath to point to those jars when you execute your application.
    E.g.
    java -classpath ./classes/;./lib/somejar.jar;./lib/anotherjar.jar MainClassKaj

  • Setting CLASSPATH and PATH properly how?

    I have set PATH=c:\jdk_install_directory\bin which works fine. However, for example when I create an app or small program for example, simply to print out a line on the screen, it works when I compile in NetBeans. However, if I copy the java file to another directory, my C: root for example, I can compile it, but when I run the class file it gives me errors saying it can't find certain classes. So, I figure its something with the classpath variable that I have to fix. How can I do this properly for both J2SE and J2EE using default install directories for each.
    Thanks so much!!

    Your PATH is exactly what it should be.
    The CLASSPATH answer depends on where you're compiling and running.
    If you're doing things on the command line, I think the right answer is to use the -classpath option on javac.exe and java.exe.
    If you're using NetBeans or another IDE, the right answer is to add JARs and paths according to the idiom demanded by the IDE. Each one is different, and all the ones I know of ignore the system CLASSPATH environment variable. I don't have one set on my machine.

  • Problem in setting CLASSPATH and PATH

    I am a newbie in java. I downloaded and run the "j2eesdk-1_4_01-windows.exe" from Internet. By default, it creates a new user variable, which is "PATH = C:\Sun\AppServer\bin". My problem is when I try to compile a java, I get an error message, which is
    'javac' is not recognized as an internal or external command,
    operable program or batch file.
    I create a new user variable which is "CLASSPATH = .;C:\Sun\AppServer\jdk\bin"
    and add new variable into my system variable, which is
    "PATH = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Sun\AppServer\jdk\lib"
    However, it doesn't work and give the same error message. Any idea about the solution?
    Thanks in advanced.

    Your PATH variable needs to include the path to the J2SE SDK bin directory. It looks like you added it to your CLASSPATH instead

  • Manually Create Packages

    I know this may sound a little strange, and you'll be wondering... "Why don't you just use makepkg?
    Well, I don't actually use Arch Linux, and have always used FreeBSD, but I was interested in pacman , which I decided to port and run on FreeBSD, all is well, but now I'm stuck at creating packages from within the ports.
    The idea was to make a script, which would build the port, then package up the binary files that are in 'work/$portname-$portversion' and create packages that would be compatible with pacman .
    I was wondering if anyone knew the steps to manually create packages from a compiled source, so then I can implement it into a working script to use with my port tree.
    Any help would be greatly appreciated.
    [amzo@Bahamut ~]$ uname -a ; pacman -V
    FreeBSD Bahamut 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:15:25 UTC 2012 [email protected]:/usr/obj/usr/src/sys/GENERIC i386
    .--. Pacman v4.0.3 - libalpm v7.0.3

    The reason I won't use Makepkg, is because the PKGBUILDS, won't build under FreeBSD. I've kinda made a working script to make packages, but it's no where near advance as makepkg is.
    Well, it seems to be working fine for now, but doesn't handle dependencies well.
    #!/bin/bash
    me=`basename $0`
    myver='1.0'
    startdir=`pwd`
    pkgname=`grep PORTNAME= Makefile | awk '{print $2}'`
    pkgver=`grep PORTVERSION= Makefile | awk '{print $2}'`
    [ -f /etc/makepkg.conf ] && . /etc/makepkg.conf
    strip_url() {
    echo $1 | sed 's|^.*://.*/||g'
    if [ ! -f $startdir/Makefile ]; then
    echo "error: Are you in the port directory?"
    exit
    fi
    # Make pkg dir
    mkdir -p pkg
    # build
    echo "==> Building Package..."
    make PREFIX=$startdir/pkg install
    # write the .PKGINFO file
    echo "==> Generating .PKGINFO file..."
    cd $startdir/pkg
    echo "# Generated by makepkg $myver" >.PKGINFO
    echo -n "# " >>.PKGINFO
    date >>.PKGINFO
    echo "pkgname = $pkgname" >>.PKGINFO
    echo "pkgver = $pkgver" >>.PKGINFO
    # remove info files
    cd $startdir
    rm -rf pkg/usr/info pkg/usr/share/info
    # strip binaries
    cd $startdir
    echo "==> Stripping debugging symbols from libraries..."
    find pkg/{,usr,usr/local}/lib -type f \
    -exec /usr/bin/strip --strip-debug '{}' ';'
    echo "==> Stripping symbols from binaries..."
    find pkg/{,usr,usr/local}/{bin,sbin} -type f \
    -exec /usr/bin/strip '{}' ';'
    # tar it up
    echo "==> Compressing package..."
    cd $startdir/pkg
    tar czvf $startdir/$pkgname-$pkgver.pkg.tar.gz .PKGINFO *
    cd $startdir
    echo "==> Finished";
    And the packages play fine with pacman. Wooo
    [amzo@Bahamut /usr/ports/x11-wm/dwm]$ sudo pacman -U dwm-6.0.pkg.tar.gz
    loading packages...
    resolving dependencies...
    looking for inter-conflicts...
    Targets (1): dwm-6.0
    Proceed with installation? [Y/n] y
    (1/1) checking package integrity [#############################################################################] 100%
    (1/1) loading package files [#############################################################################] 100%
    (1/1) checking for file conflicts [#############################################################################] 100%
    (1/1) checking available disk space [#############################################################################] 100%
    (1/1) installing dwm [#############################################################################] 100%
    The only problem that this brings to the field, is that it doesn't play nice with the database:
    error: invalid name for database entry 'dwm-6.0'
    Maybe someone could help me here a bit, someone who's more experienced with creating packages?
    Last edited by Amzo2 (2012-06-03 13:42:07)

  • A question about CLASSPATH and Package

    The configuration of my computer is:
    Windows98, C:\j2sdk1.4.0
    Which in Autoexec.bat are included like this:
    path=C:\j2sdk1.4.0\bin
    set CLASSPATH=C:\j2sdk1.4.0\lib
    Then I make a new directory named t in C:\j2sdk1.4.0\lib, where there is a compiled file a.class, source code is:
    package t;
    public class a
    And another java file was in D:\t, named b.java, code like this:
    import t.*;
    class b extends a
    public static void main( String[] args )
    System.out.println("OK");
    Then I compiled like this: javac b.java, it was wrong; but when I compiled like this: javac -CLASSPATH C:\j2sdk1.4.0\lib b.java, It was OK!!! Why?? And then when I execute like this: java b, an error message was prompted(Can not find class t/a)!!! How can I do?

    First one general comment: I would not advise putting your own classes into C:\j2sdk1.4.0\lib since this suggests that the classes under this directory belong to the Java distribution. So my advice: create your own directory somewhere like D:\user\Classes or whatever.
    The directory (-ies) you specify in CLASSPATH are root entries telling the JVM where to start looking for classes. Why root entries? Well, the package structure is reflected in the directory structure relative to these roots. So a class of package t belongs into the subdirectory t of one of the directories specified in your CLASSPATH. This would be the case of your class a - by the way, the convention says that class names are capitalized. Since class b, on the other hand, is not in any package, it belongs irirectly into one of the directories of your CLASSPATH.
    Whereas the compiler is fairly forgiving about the location of your source files, the JVM is not. Invoking a class of some package requires you to provide the fully-qualified name to the java command. So if you wanted to run class a, you would have to invoke "java t.a". Starting class b, simply requires a call of "java b". But make sure the class file of class a is located in the subdirectory t of one of the directories specified in your CLASSPATH.

  • Problems in Classpath and Path 's variables setting in Windows XP

    Here is my drive structure in my PC:
    1. hard drive (primary slave, Partition: C and E where E boot Windows XP
    2. Hard drive 2 (Primary Master), Drive letter: D
    Although my default boot directory is E (for strange reason, i like to keep
    that way for now), I installed other programs in C and D drive dues drive
    space factors.
    So My java sdk1.4.2_02 has been installed in C:\Java_home directory, the
    following is my Classpath and Path values:
    (CLASSPATH Variables)
    Classpath=.;
    c:\java_home\j2sdk1.4.2_02;
    e:\Program Files\java\j2re1.4.2_02;c:\java_home; c:\java_home\j2sdk1.4.2_01
    \lib;e:\Program Files\java; e:\Program Files\java web start;c:\java_home\j2
    sdk1.4.2_02\jre\lib;c:\java_home\java\petstore1.3.2\src\lib\jst1;
    (PATH variables)
    c:\java_home\j2sdk1.4.2_01\bin;C:\java_home;e:\Pr
    ogram Files\java;c:\java_home\jdk1.4.2_2\bin;E:\Program Files\Oracle\jre\1.
    1.8\bin;E:\WINDOWS\system32;E:\WINDOWS;E:\WINDOWS\system32\WBEM;E:\
    Program Files\Support Tools\;
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
    Path=D:\oracle\ora92\bin;E:\Program Files\Oracle\jre\1.3.1\bin;
    My Fruit txt and Fruit.java file is located in my c:\java_home folder
    when I try to compile the my file as <c:\java_home\javadoc Fruit.java), it
    gives me the error message<'javac' is not recognized as an internal or
    external command,operable program or batch file.>
    however, I can compile the Fruit file from C:\java_home\jdk1.4.2_2
    \bin\javadoc Fruit.java; with out any problem of course I have to copy the
    Fruit.java file at the C:\java_home\jdk1.4.2_2\bin\javadoc Fruit.java
    folder.
    I am requesting u please help or advise me to correct my mistakes
    Ely
    [email protected]

    I must confess that I am totally unable to understand what your PATH is set to. The error that you see,
    <'javac' is not recognized as an internal or external command,operable program or batch file.>
    is due to a missing or incorrectly set PATH. It is used by Windows to find executable file (like javac.exe) that you have added to the computer. Item #5 on this page gives you instructions on how to set it: http://java.sun.com/j2se/1.4.2/install-windows.html
    As for the setting of the CLASSPATH, you seem to have a number of different versions of java (1.4.2_02, 1.4.2_01, 1.4.2_2, and 1.1.8) and I doubt that these are all valid. You are also using an unusual syntax C:\java_home\jdk1.4.2_2\bin\javadoc Fruit.java and I wonder if that is really C:\java_home\jdk1.4.2_2\bin\javadoc\Fruit.java? I think the best action is to point you to Sun's instructions and information about setting and using the CLASSPATH.
    The CLASSPATH is a set of pointers that is used by Java to find the files that YOU (not Java) create and want compiled and/or run.
    Setting the Classpath:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html
    [NOTE: always start your classpath with ".;" which means the current directory. See my classpath, below]
    How Classes are Found:
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html
    Examples:
    This is my path
    PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BATCH;C:\J2SDK1.4.2_01\BIN;C:\PROGRA~1\UTILIT~1;C:\PROGRA~1\WIN98RK
    This is my classpath
    CLASSPATH=.;C:\mjava;C:\mnrx;C:\NetRexx\lib\NetRexxC.jar;C:\j2sdk1.4.2_01\lib\tools.jar;C:\NetRexx\NrxRedBk

  • Package does not exist even though I set classpath right!

    Hi, my JSP got an error message saying "Package does not exist" at line
    <% import ="org.jfreechart.*"%>
    And I have put the myjar.jar file containing the above classes into blabla\WEB-INF\classes,(where blabla is my current working directory) and set my classpath= blabla\WEB-INF\classes
    It does not either if set classpath= blabla\WEB-INF\classes\myjar.jar
    Anybody could give suggestion? By the way I am using Tomcat.

    your .jar files should be in WEB-INF/lib

  • Is it legal to create packaged APEX applications and sell them?

    Is it legal to create packaged APEX applications and sell them to Oracle DB licensed clients?
    A.

    No licensing applies to any environment where you have a live database. The exception is that you can try a product without license, but as soon as development of a product of developing/testing of an in-house solution is done, you need to be licensed. Being a partner changes this slightly assuming all parties involved are partners (one sigle tester from the outside shifts it back to full license mode).
    Another situation where license is not needed is to use XE for which no license is required.
    Yet one more way to have al low cost is to use Amazon AWS to set up an image with an included license. The cost per hour is really low so it may be a good model to not have to pay everything upfront.
    You can also reduce license cost by using named user licensing in development assuming there are few people who ned to access the database. Though there are minimums of number of named user licenses you can have depending on edition of the database.
    Overall, knowing your licensing requirements is key. The defense "We didn't know" has been tried before and has not proven to help at all. The cost of an audit will often be a CLM for the person responsible to pay the licenses.

  • Music and Video on Nas in folders but how do i set up itunes on multiple computers to see and use these files and create libraries?

    Music and Video on Nas in folders but how do i set up itunes on multiple computers to see and use these files and create libraries?
    So i have had a itunes set up on my old PC, bought a NAS and copied the folders over to the NAS, i did this incorrectly and so then even when i told the old PC to use that folder it saw all the songs but wasnt able to play the songs as it was looking in the incorrect place.
    So now i want my Mac as well as my PC and others to all use the music, videos etc on the NAS they are in itunes friendly folders (as they were compiled this way by the itunes on the old PC.
    When i tell the mac to use the itunes library.itl file it sees the song list (about 100gb) but cant see any songs, so i have removed this file to another location for now with the hope to set up a new file and then get it to see the songs on the folder from the NAS.
    Can someone tell me how to do this for all the Mac's and PC's on my network as i really want one master library that all use and add too.
    Thanks for your help in advance.

    I have the same question but I am using two pc's

  • How can I set BPEL server enviorment and create BPEL domain?

    Without use the http console, how can I set BPEL server enviorment and create BPEL domain?
    When I try to use API like below
    import com.oracle.bpel.client.Server;
    Server s = new Server(ServerAuthFactory.authenticate("oracle","localhost"));
    But I always got four exceptions and one warning like below:
    java.io.FileNotFoundException: C:\Workspace\WOSEDISystem\BPEL_Domain_Creation\config\security.properties (The system cannot find the path specified)
    java.io.FileNotFoundException: C:\Workspace\WOSEDISystem\BPEL_Domain_Creation\config\ejb.properties (The system cannot find the path specified)
    Warning: unable to read transaction.interoperability config property
    java.io.FileNotFoundException: C:\Workspace\WOSEDISystem\BPEL_Domain_Creation\config\security.properties (The system cannot find the path specified)
    java.lang.Exception: Failed to create "ejb/collaxa/system/ServerBean" bean; exception reported is: "javax.naming.CommunicationException: Can't find SerialContextProvider
    Is it right to use com.oracle.bpel.client.Server like this, please help me.
    Best regards,
    Vita

    Anyone can help me? Because I need deploy BPEL process on production server, so I need the Java funtion to create domain. Thank you very much if you can tell me the correct method of using com.oracle.bpel.client.Server API.

  • I have a new email address. Changed this on my itunes account. On iPhone deleted old icloud account and created new with new email. I have set find my phone to on. When I download music it no longer goes to icloud an does not show up on my iphone.

    I have a new email address. Changed this on my itunes account. On iPhone deleted old icloud account and created new with new email. I have set find my phone to on. When I download music from itunes it no longer goes to icloud an does not show up on my iphone.

    I have the same problem - it is maddening. I rely on this iPad for work so this is not just an annoyance! The above solutions of changing the appleid on the device or on the website do not work.
    The old email address no longer exists - I haven't used it in a year probably and I no longer have the account.  I logged into the appleid website and there is no trace of the old email address so there is nothing that can be deleted or changed there.  On the iPad there is no trace of the old email address so nothing can be deleted there either. I have updated the iPad software and the same problem comes right back.  Every 2 seconds I am asked to log in using the old non-existent email.  The device is currently useless.
    The only recent change to anything was the addition of an Apple TV device, which was set up using the correct login and password.
    Does anyone have any ideas? The iPad has been backed up to the iCloud so presumably it now won't recognize the current iCloud account? So restoring may notbe an option?

  • Setting PATH and CLASSPATH in Java Applet

    Hi,
    I have been wondering if there was a way to set the PATH and the CLASSPATH in the HTML file within the <APPLET> tag...
    What I would like to do is to read some xml files outside of the directory where my html file is located to run my test application with the configuration on my computer.
    (The applet and the html file from which it is called is on my local host.)
    Therefore, I have seen that in order to access local files, I have to sign my jar files, which I did.
    But the tricky part is that for my test application to work, I need to set the PATH and the CLASSPATH... and I have no idea if this is possible or not...
    I have seen that:
    *CODEBASE: I specify here the main directory where my jar files are located
    *ARCHIVE: I specify here the list of my jar files
    In my case:
    CODEBASE=../../   (this is the root directory of my whole application)
    ARCHIVE=dir/lib/jar1.jar,dir2/jar2.jar,configXML/,etc...I don't know if I can specify the filepath of my xml files (here "configXML") in ARCHIVE (I suspect we can only specify jar files there... right ?)
    Maybe I can use ARCHIVE this way to specify my CLASSPATH (and well... not completely the way I would like I suppose), but what about the PATH ?
    I have been searching this for soooo long now...
    Any help, hint or suggestions (I might doing this all the wrong way...) would be greatly appreciated !
    Thanks in advance !

    You need to use the code attribute to specify the class that contains the main method to start the application.
    <applet code="myPackage.myClass.class" codeBase="http://www.someServer/someFolder/" archive="myApplet.jar">
    I hope this solves part of your problem at least.
    Andrew

Maybe you are looking for