Using the "java" command in Java 1.4.1

Hello..
I don't seem to be able to run any application that should run with
the "java" command in Java 1.4.1. Everytime I use "java" I get the "java.lang.NoClassDefinitionError"
Even running this simple program doesn't work:(
package chapter10;
public class test {
public static void main(String args[]) {
System.out.println("Hello WORLD!!");
}//end class
when I run: "java chapter10/test"
I get the following message:
"Exception in thread 'main' java.lang.NoClassDefinitionError: chapter10/test"
And the sam happens to any other class when I try to run it:(
The "javac" command works fine:) but the "java" is giving me a hard time:(
I would appreciate any suggestions or answers to this problem:) THANK U

See if this explanation helps.
Assume that your programs are part of a package named divelog, which is specified by the first line in each source file: package divelog;
Also assume that this directory (C:\javaT\myWork\) is part of the CLASSPATH list of directories.
Also assume that all the source files reside in this directory structure: C:\javaT\myWork\divelog\
Then a statement to compile a source file Named Divelog.java is:
C:\JavaT\myWork\>javac divelog\Divelog.java
Explanation:
Java starts looking for classes in the directory(s) listed in the classpath. In this case, one of the directories should be: C:\JavaT\myWork\ since it contains your divelog package.
Compiling
A class can either be part of a package (ie, no package statement at the top of the class.), or not.
If the class is not part of a package: Its source file needs to be in one of the classpath directories. To compile you use the command: javac SomeFile.java, from within the classpath directory that contains the file.
The class is part of a package (this case): The source file must be in a subdirectory structure that starts in one of the classpath directories. The subdirectory structure must match the package statement.
So, you generate a directory structure C:\javaT\myWork\divelog\ which is the [classpath directory + the package subdirectory structure], and place Divelog.java in it.
Then from the classpath directory (C:\JavaT\myWork\) use the command: javac divelog\Divelog.java
This creates a file, Divelog.class in the divelog 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: divelog.Divelog (note I omit the .class)
Running
To run a class that's not part of a package: From within the classpath directory that contains the class. use the command: java SomeFile
To run a class that is part of a package: From within the classpath directory (C:\JavaT\myWork\) use the command java divelog.Divelog (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)

Similar Messages

  • Need to change the directory using the java program

    hi,
    can anyone give me the code to change the directory in the java program by using the system command.
    as in C where we use the system call system("cd");
    the same way how to do that in java. please help me with that!!!

    Please search the forums for "runtime.exec", there are dozens of examples posted.
    Although this may not do you any good, since changing the os's directory is not likely to change anything you're using in Java. What are you trying to do?

  • Is it possible to use the JAVA Report Engine SDK to modify DESKI reports?

    Post Author: Nadine
    CA Forum: JAVA
    Hi, is it possible to add a complex filter to a DESKI report using the JAVA report engine sdk?
    In the developer tutorials for this API, I've only found references to WEBI in terms of modifying reports, though it seems to be possible to view DESKI reports with this sdk.
    I am a bit confused in terms of the scope of this API and how I would use it in regard to DESKI.
    Many thanks for any suggestions!
    Nadine

    Post Author: Ted Ueda
    CA Forum: JAVA
    Current (XI R2) version of ReportEngine API only supports refreshing/viewing functionality for Desktop Intelligence documents.  Document modification/creation is only supported with Web Intelligence documents.  Queries aren't modifiable for Deski using ReportEngine API - you can only do so using Desktop Intelligence Reporter SDK, which is COM based.Sincerely,Ted Ueda

  • How to Use the JAVA SCRIPT code in .htm page of the component

    Hi .
    In my requirement i have to use Java Script Function in .htm code ..how to use the java script code and functions in .htm???
    thank you
    B.Mani

    Check this document  [Arun's Blog|http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebClientUI-TalkingwithJava+Script]
    Regards
    Kavindra

  • How do I create a user, in my context in OID using the Java API

    How do I create a user, with subschema, in my context in OID using the JAVA API
    I need to be able to create new users in my OID, I was doing it in our old iPlant Directory, but I don't seem to see the same methods in the Oracle LDAP API. I figured out how to get and modify the attributes of a user, but I can't seem to figure out how to add a new one.

    Try this code , modify it accordingly
    ------- cut here -------
    import oracle.ldap.util.*;
    import oracle.ldap.util.jndi.*;
    import javax.naming.NamingException;
    import javax.naming.directory.*;
    import java.io.*;
    import java.util.*;
    public class NewUser
    final static String ldapServerName = "yourLdapServer";
    final static String ldapServerPort = "4032";
    final static String rootdn = "cn=orcladmin";
    final static String rootpass = "welcome1";
    public static void main(String argv[]) throws NamingException
    // Create the connection to the ldap server
    InitialDirContext ctx = ConnectionUtil.getDefaultDirCtx(ldapServerName,
    ldapServerPort,
    rootdn,
    rootpass);
    // Create the subscriber object using the default subscriber
    Subscriber mysub = null;
    String [] mystr = null;
    try {
    RootOracleContext roc = new RootOracleContext(ctx);
    mysub = roc.getSubscriber(ctx, Util.IDTYPE_DN, "o=dec", mystr);
    catch (UtilException e) {
    e.printStackTrace();
    // Create ModPropertySet with user information
    ModPropertySet mps = new ModPropertySet();
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"cn", "Steve.Harvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"sn", "Harvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"uid", "SHarvey");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"givenname", "Steve");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"mail", "[email protected]");
    mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,"userpassword", "welcome1");
    // Create the user
    User newUser = null;
    try {
    newUser = mysub.createUser(ctx, mps, true);
    System.out.println("New User DN: " + newUser.getDN(ctx));
    catch (UtilException e) {
    e.printStacktrace();
    ------- end cut --------
    Enjoy.
    Suhail

  • Should i use the Java edition ?

    Hi,
    i'm not sure if i should use the Java edition or the "normal" edition of the berkeley db.
    My application is developed in Java, but i won't be using either JTA, JCA or JMX.
    Is there still any advantage to be taken from using the Java edition ?
    Thanks

    There are many minor differences, e.g., JE has somewhat better write performance, DB uses somewhat less memory, DB has an SQL interface and JE does not. But overall, the two products are very similar, so for most questions you might ask, the answer is going to be "about the same".
    If you want to choose the best product for your app, you'll have to define the very specific criteria that are most important to you. If you care most about getting every ounce of performance out of a specific piece of hardware, using a specific amount of memory, for a specific app (access pattern), then you'll have to write a test and do a comparison.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Why to use the Java API in MDM

    Hi Experts,
    I am new to the MDM.
    We are having the requirement of inetration between Portal and MDM.Can u please tell me when to use the following coponents like the scenorio's.
    Why to install the MDM Business packages in Portal?
    why to use the JAVA API.
    Please give me the complete information.
    Regards

    Hi Vijay,
    Standard Business Package is use to provide interaction between MDM Server and the Portal. It consists of MDM iViews like Item Detail iView (allows to create,edit and delete the records) , Resultset iView (Displays the records, allows to add the records in workflows etc), Search iViews (for searching)i.e. Data Manager functionality.
    Java API are used when you need some functionality that standard MDM iViews dont have.MDM Java API consists of set of classes and interfaces with the help of which customization can be done.
    Regards,
    Jitesh Talreja

  • How to use the Java embedding activity in BPel

    hi all,
    How to use the java embedding activity in BPEL
    pls can u provide sample example

    1 Use [Oracle BPEL Process Manager Client Java API Reference|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/overview-summary.html] and especially [com.collaxa.cube.engine.ext|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/com/collaxa/cube/engine/ext/BaseBPELXExecLet.html]
    Instead of System.Out.println use addAuditTrailEntry(java.lang.String message)
    2. If you want to import a package write in code (Source View) of bpel process
    +<bpelx:exec import="package_name"/>+ for example +<bpelx:exec import="java.util.regex.Matcher"/>+
    example 1:
    String bodyAsString;
    StringBuffer myStringBuffer = new StringBuffer();
    try {
    bodyAsString = (String)getVariableData("BodyString");
    addAuditTrailEntry("bodyAsString1: "+ bodyAsString);
    Pattern pattern = Pattern.compile("goodDay");
    Matcher matcher= pattern.matcher(bodyAsString);
    while (matcher.find()) {   
    matcher.appendReplacement(myStringBuffer, "shitDay");
    matcher.appendTail(myStringBuffer);
    bodyAsString = myStringBuffer.toString();
    addAuditTrailEntry("bodyAsString2: "+ bodyAsString);
    } catch (Exception ex) {
    addAuditTrailEntry("Failed+bodyAsString",ex.getMessage());
    I put in code (Source View) the following
    <bpelx:exec import="java.util.regex.Matcher"/>
    <bpelx:exec import="java.util.regex.Pattern"/>
    example2:
    Object temp;
    try {
    temp = ((XMLElement)getVariableData("inputVariable","payload","/ns2:FiscalisMessage/ns2:Body")).getChildNodes().item(1);
    setVariableData("AdjReceipt",temp);
    addAuditTrailEntry("ok",temp.toString());
    catch (Exception ex) {
    addAuditTrailEntry("Failed :",ex);
    I put in code (Source View) the following
    <bpelx:exec import="oracle.xml.parser.v2.XMLElement"/>

  • Using the JAVA ImportXmlTemplate function, should I always use XSL directory?

    Using the JAVA ImportXmlTemplate function requires XSL directory, I do not need XSL for my updates, how can I workaround this requirement?

    Ok, thanks for your quick answer. I saw you last blog posting regarding simple bar codes, I hope your next one turns up soon (read: today ;-) ).
    I did take a swing at writing my own class according to the user guide, using JDeveloper. One of my problems is that I am not that familiar with the whole java world, my experience lies almost entirely within .NET development. So when I read stuff like "make sure the class is available in the classpath for the JVM" and things like that, it is not a detailed enough description for me in order to make anything out of it. Do you think you can clarify that for me?
    I also wonder if you have any tips and tricks on how to trace/log information from the class when it executes? Because I think that I can actually get it to be called, it's just that something goes wrong and the generated PDF becomes badly formatted and has no content. I can see that some calls are made to a Logger class inside the example class. I guess that I need to set up some runtime configuration for that information to turn up in a file, but again me lacking experience from the java world prevents me from accomplishing that :-)
    Regarding tracing and logging from the java classes for the BI Publisher, can I get them to trace or log debug information in some clever way?
    The app I am developing is a .NET app that calls these classes using a product called juggerNET. I am developing a print direct application for JDEdwards EnterpriseOne since BI Publisher is not entirely integrated into it yet.
    I would greatly appreciate a quick reply this time as well if you can find the time!
    Best regards, Jörgen

  • Handle a pdf using using the Java-based programming

    Could I handle a PDF document created by LiveCycle using the Java-based programming?
    I want to say, don't use the LiveCycle server-based application.
    I'm developing a small desktop application. This application read from the database and populate a PDF document. The PDF document has many forms and they use a button to increment the field in the subform or duplicate the subform.

    Could I handle a PDF document created by LiveCycle using the Java-based programming?
    I want to say, don't use the LiveCycle server-based application.
    I'm developing a small desktop application. This application read from the database and populate a PDF document. The PDF document has many forms and they use a button to increment the field in the subform or duplicate the subform.

  • Using the Java API

    Hi everyone,
    I just wanted to see if anyone knows whether I need a license to use the Java API included in the trial version of Adobe LiveCycle ES.
    I need to include some PDF manipulation code for dynamic XFA forms in an application, and I first read that XPAAJ jar was free. So is the API here also free or do I need a license? If anyone knows, could you please point me in the direction of the details if a license is needed.
    I would appreciate your help.
    Thanks.
    Mira.

    Mira
    You don't need a license as long as the application you're building is for evaluation or testing, and NOT for production use.
    You will need to purchase a license for production use.
    Licensing can be complex, and you should contact your local Adobe office or enterprise partner for details.
    XPAAJ was never free, it was bundled with other Adobe products.
    It has been deprecated, and is no longer supplied or supported, as far as I'm aware. You will need to purchase a LiveCycle license of some sort.
    Howard
    http://www.avoka.com

  • Using the java (tm) Icon...

    If you've made an application, can you use the JAVA icon (as in the left top corner of this page) in the aboutdialog of your application?
    Is it legal?
    thx,
    sjg

    Short answer, no. See http://www.sun.com/smrc/logos/brand

  • Using the Java API to address a specific instance

    Hi,
    I've created another operation (onRequest) in the client of an async. process.
    <!-- portType implemented by the Exp2 BPEL process -->
    <portType name="Exp2">
    <operation name="initiate">
    <input message="tns:Exp2RequestMessage"/>
    </operation>
    <operation name="onRequest">
    <input message="tns:Exp2onRequestMessage"/>
    </operation>
    </portType>
    I then use this operation in a recieve activity so that I can stall the flow of the instance, and then call it whenever I whant from a RMI client.
    <receive createInstance="no" name="onRequest" partnerLink="client" portType="tns:Exp2" operation="onRequest" variable="inputRequest"/>
    My problem is that, after the creation of one or more instances of this process, how can I send a post message to a specific instance using the Java API?
    I understand that i should use something like...
    deliveryService.post("Exp2", "onRequest", nm );
    but there's nothing to "say" that this post message is to be delivered to the instance with the ID "xx".
    I also know that I need to use correlation on this but I don't know how.
    I would really apreciate some help on this.
    Thanks...

    This is a very good question: here is a code snippet that shows how you can add a conversation id to the NormalizedMessage that you are sending to the delivery service.
    HashMap properties = new HashMap();
    properties.put("conversationId", "yourUniqueKeyHere");
    // construct the normalized message and send to the
    // delivery service
    NormalizedMessage nm = new NormalizedMessage( );
    nm.setProperties(properties );
    // The rest is the same
    nm.addPart("XXX" , someElement );
    Please note that you will need to use the conversationId property both with the message you use to initiate the BPEL process and the message you use to perform the onRequest call.
    Please note that if at some point you want to perform any of the 2 calls through the SOAP channel, you can embed he conversationId in the WS-Addressing header within the relateTo element.
    I hope this helps.
    Edwin

  • Using the Java APIs

    I am attempting to use the java api in my reporting solution. The application that we are developing is using JSF and java. I wanted to keep the same look and feel for my reports.
    First, I created a very simple rtf template in Microsoft word using BI Publisher Desktop. This simple template is just a table layout of data. No groupings. I created my datatemplate and ran the DataProcessor, the RTFProcessor, and FOprocessor objects. This worked correctly.
    I next created another rtf template. This rtf template contains a grouping on Po_Number. I also modified my data template to group by Po_number. The DataProcessor and the RTFProcessor works fine. However, the FO Processor gives me the following message:
    XDOException <Line 43, Column 93>: XSL-1015: (Error) Function 'current-group' not found.
    However, I can successfully preview this template (with data) in Microsoft Word. Any ideas what may cause this.

    It's either a template issue or your missing some jar files (probably jar files).
    I would highly recommend you download the BIPublisherIDE. All this code and framework is already written and it's free!
    http://bipublisher.blogspot.com/2008/03/bi-publisher-bipublisheride.html
    Ike Wiggins
    http://bipublisher.blogspot.com

  • Using the Java DOM properly

    I am new to the Java DOM (package org.w3c.dom) and have read several tutorials on its basic use, but cannot find the answers to what I feel are some very basic questions.
    In org.w3c.dom (the "Java DOM"), Documents, Elements and Nodes are interfaces all representing the components of an XML document, which is a tree structure where each node can have 0+ children (representing the recursive nature of XML itself). The Document interface represents the entire document, whereas Elements (which extend Nodes) represent a specific tag/element in an XML document, and all of its children (the subtree extending from the Element).
    QUESTION #1: What class, then, actually represents the tree data structure of the XML document? Document, Element and Node are interfaces, meaning they can only provide abstract methods and static members. For instance, Node has a method called "getFirstChild()"... since this is an interface method, it has to be abstract... so where is it defined? Another way to look at this question is:
    noises.xml
    ========
    <animals>
         <cow noise="moo"/>
         <dog noise="woof"/>
    </animals>
    DomTestDriver.java
    ==================
    DocumentBuilderFactory dbf = new DocumentBuilderFactory()
    DocumentBuilder db = dbf.newInstance();
    Document doc = db.parse("noises.xml");
    Element root = doc.getRoot();
    Element cow = root.getFirstChild();Here I have read/parsed noises.xml into a Document object. I am now free to explore the document, modifying it as I wish, etc. When I call root.getFirstChild(), somewhere, somehow, a tree structure is holding an in-memory version of noises.xml, and getFirstChild() queries that structure for the correct Node to return... what is this structure?!? It must be a class... so what is it???
    ***End of Question #1***
    Second, it would be nice if I could modify a Document object or Element at runtime. For instance:
         Element horse = new Element();
         horse.setTagName("horse");
         horse.setAttribute("noise", "naaay");
         root.replaceChild(horse, cow);
         // Now, the 'doc' Document object, which originally parsed noises.xml, looks like:
              <animals>
                   <horse noise="naaay"/>
                   <dog noise="woof"/>
              </animals>
         */Several problems with the code sample above:
    (1) Element is an interface! I can't instantiate it like "Element horse = new Element();"
    (2) Neither Element nor Node specify a "setTageName(String)" method, telling me that Java     does not want me using the Java DOM like this... why?!?!
    QUESTION #2: So, if my code sample above doesn't work, how do I create new Element objects and insert them into my Document object, or into another Element's subtree?

    the top hit for the google search "java dom tutorial" should answer questions 2 and 3. as for 1, the answer is "it doesn't matter". the point of frameworks designed like this is that each jdk implementation is free to provide its own, compatible dom implementation. in case you are curious, the sun jdk implementation uses a modified version of apache xerces, but like i said, that doesn't really matter and should not be visible to you.

  • Using the java.util.logging in JDK1.3

    I would like to use the java.util.logging classes of JDK1.4 in JDK1.3. So I tried creating a new jar with only the java.util.logging package, however, javac generates the error:
    >>>>>>
    bad class file: E:\ThinClient\Log\logging.jar(java/util/logging/Logger.class)
    class file has wrong version 48.0, should be 47.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    <<<<<<<
    I tried placing the jar both in classpath and bootclasspath during javac and still was not successful, is there any way of getting around this, other than re-implementing this or getting some third parties implementation such as Apache's log4j?

    check out Lumberjack in sourceForge

Maybe you are looking for

  • Regarding Workflow - eApprovel mail

    Hello Experts, I am new at SAP workflow.. This is regarding Workflow issue, before upgradation (4.6 to 6.0) means in 4.6, prior to upgrade the eApproval mail showed the approver and the status of PO in the approval cycle like below Vendor : vendor na

  • Inserting 000 into a column

    i have to insert three zeros into a column. if i do it only one zero is getting inserted. please advice. cheers, AJ

  • Problem when droing quicktime movie into idvd

    Hi, i have created a movie in final cut express and exported it using quick time movie. i then drop this into idvd and burn the disc. Although when previewing the footage in final cut express everything looks ok when i play the movie from the disc it

  • Unable to start Admin Console in Internet Explorer

    Hi All, I Installed EPM 11.1.2 and all the configurations were succeeded with out any issues. When i open Adminbistration console i am able to open but when i open with IE using the url : http://svalmiki-pc:10080/easconsole/console.html i am getting

  • Java on Linux

    Hey, I downloaded the java VM for my Red hat Linux OS i got on my box. I thought it bought time i got it. Well, i also wanted to test my game on the java VM for Linux, as i have tested it on the Windows Java VM and it works perfectly. However with th