Java Flavor???

Hi All,
I want to go on Java training as my next assignment requires application development using Web Dynpro and IView development using Java. I wanted to get your output as to which training course will be the best to go for. Should I go for regular Java or Java server pages(JSP) or the Enterprise Java beans(EJB). Can someone recommend anything and tell me which flavor of java is used with Web Dynpro and which one is used with Java IView development?
Thanks in advance.

Hi Anurag,
For Web Dynpro you should know the following
1. All important packages of Core java.
2. Model View Controller methodolgy.Design patterns is desirable and definitely a plus.
3. Servlet and JSP if you want to use Web development in your project.
4. JCO development predominantly you will use JCO to connect to R/3 with Webdynpro.
5.Dynamic progamming with Webdynpro.
6.Debugging & validations using webdynpro.
For Java iView Development:
1.Basics of EP
2.Configuration of EP with Webdynpro
3.Basics of JSPDynpages.
4.Personliazation using EP.
5.Basics core java,jsp
FOr above two you shd be familiar with Netweaver Studio IDE.
Regards,
Guru

Similar Messages

  • Transforming java Code from one Flavor to another

    How do you transform java code from one flavor to another.
    Please help
    Juan

    what's that - java flavor ?

  • Since I installed yosemite I get a window to install legacy JAVA SE 6 RUNTIME and can't run ADOBE Illustrator Cs6 without it .

    So anything LEGACY means it is probably not supported and chocked full of security  issues.
    what JAVA flavor do I need to install?
    WHat do I do ?
    I have a lot of work to do...
    thanks in advance

    Hi,
    Try this:
    Download Java for Mac OS X 2014-001 from http://support.apple.com/kb/dl1572. 
    Install the Java update using the downloaded .dmg file. 
    When installation is complete, a Software Update dialog box appears. The dialog box asserts that Java SE 6 Runtime is required to run Adobe Illustrator CS6.
    In the Software Update dialog box, click Install. 
    Launch Illustrator.
    In Adobe Illustrator CS6 some plug-ins has dependency on Java, therefore Java is required for them to function properly.
    With Best Regards,
    Raghuveer

  • PI 7.0 or 7.1 ?

    Hello! I have a choice - use PI 7.0 or 7.1 in my new project. I only have an experience with PI 7.0
    Could you advice me what to use? Is PI 7.1 more effective than 7.0 ? Is there important new features in 7.1 ?
    Thanks for answers!

    Dear Andrey,
    It would be better to go with PI 7.1 as now or in the near future you will need to upgrade to PI 7.0 . Moreover nowdays clients are asking for developments to be in the newer version of XI.
    As for important features.
    1. Decentralized processing
    Consider that PI 7.1 also introduces the concept of decentralized processing at runtime for better optimization but keeping things in control through centralized configuration wherein which the key monitoring functionalities have been integrated in the SAP NW Administrator.
    2.  Objects Tree Filtering and Positioning
    One important set of features is the u201Cobjects treeu201D and its positioning and filtering capabilities. Just consider a list of software components like this one. Every time you start the ES Repository, you should scroll and open your particular software component and software component version. If the list keeps on growing, it is not unusable, but the time spent in positioning and the possibility or error increases.
    A nice feature to avoid it, is applying the filter functionality. It allows you to select just the set of software component and software component version you are interested in, in a particular moment.
    (Refer https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0e7734f-e969-2a10-24b6-df58a710941c)
    3. Creation of folders
    There are two additional good features regarding folder in ES Repository and Integration Directory. One is the option to execute massive commands at folder level for the objects contained. The other is the possibility to work with authorizations at folder level, what increases the granularity of roles
    (Refer /people/william.li/blog/2007/08/07/using-folders-in-pi-71)
    4. Software component relationships
    This feature has also been available for a while. It is the possibility to describe relationships at SLD level. They are required if you want to comply with the naming.
    5. Version handling
    Version handling is another powerful feature here. if you upgrade a basis one you can generate a new version for the root to include the new functionality while you keep the other basis relationships in the same version as before.
    6. Improved where used list and search utility.
    Search utility. Very comprehensible, supports wildcards and extended attributes. Also the feature of tabular search and hierarchical search available.
    7. Life cycle management: Objects activation.
    Integration builder allows you to work with inactive objects.  Other users will see the active version if available. Change list can also be transferred and also activation can be done from different places.
    8. Creation of local objects
    Local objects can be created for testing purposes there is no need to do anything in the sld.
    9. Runtime management features
    Universal Description, Discovery, and Integration (UDDI) 3.0u2013compliant services registry for runtime management of enterprise services. It is a directory that can be used to publish and discover public Web Services.
    10. Low resource consumption
    Process Integration 7.1 is based on the next release of the SAP's application server with its ABAP and Java flavors. The Java stack is Java EE 5 compliant, and offers benefits such as faster installation and lower memory consumption. As in previous releases, the application server is the robust basis for infrastructure services such as scalability, high availability, archiving, security, and user management.
    11. XML payload validation
    Payload of incoming and outgoing messages can be validated. Validation by an adapter (backward error handling): The validation is executed in the Adapter Engine. If the validation fails, an error will be raised and the message will not be processed. Validation by the Integration Engine (forward error handling): The validation is executed in the Integration Engine. If the validation fails, the message processing will be stopped in the
    Monitoring.
    12. Advanced Adapter Engine Configuration in PI
    A new feature, Integrated Configurations, is introduced in PI 7.1. This feature allows us to configure an end-to-end scenario that will process messages locally in the Advanced Adapter Engine (AAE), bypassing the Integration Engine (ABAP stack of the Integration Server). The Advanced Adapter Engine is the new name in PI 7.1 for the Adapter Engine.  The primary objective of using local processing in the AAE is to increase the performance of message processing by eliminating the need for the ABAP stack during the process. By bypassing the ABAP stack, the message processing will still keep the existing mapping, monitoring and support functionalities.
    13. Mapping Enhancements
    PI 7.1, SAP introduces significant new enhancements within the graphical mapping tool that will greatly facilitate the design and creation of message mappings. Some of the features are Importing Table Structures from a Database, Function Libraries, Parameterized Message Mappings, and Mapping Output of Intermediate Fields to Multiple Target Fields, use of graphical variables and checking for structural inconsistencies, Copying of xml sub tree. Share user defined functions, Import sql tableu2019s metadata
    (Refer:https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8282; [original link is broken] [original link is broken] [original link is broken] https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8650. [original link is broken] [original link is broken] [original link is broken]
    /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
    /people/william.li/blog/2008/01/02/sap-pi-71-mapping-enhancements-series-share-user-defined-functions
    14. New feature Point-to-Point connection using ABAP
    Point-to-point connection allows a much greater message throughput performance, simply because a middleware is not involved in message processing. However, because of this, services such mappings, dynamic receiver determination, ccBPM (as provided by the middleware) are no longer available during the message exchange.
    When an environment contains many point-to-point connections, the administration and maintenance of connections becomes quite cumbersome to support. This is where the benefit of SAP NetWeaver 7.1 Process Integration (PI) becomes obvious. PI provides a tool and infrastructure to centrally design, configure and support of the point-to-point connection. With PI, message types and interface can be designed in the Enterprise Services (ES) Repository, and connection configurations and communication channels can be done in the Integration Directory (ID). All the configuration objects are also propagated automatically to the perspective backend business systems.
    (refer : https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b00bbb77-75bc-2a10-6b9a-a6f8161515a6
    /people/william.li/blog/2008/02/13/point-to-point-connection-using-abap-in-sap-using-pi-71 )
    15. User defined Functions
    In PI 7.0 and XI 3.0, one of the most often requested features (or complaints) is the capability (or lack of) to share user-defined functions (UDFs) across multiple message mappings. As a result, we often had to duplicate the code of frequently used UDFs to multiple message mappings. This feature is now available with PI 7.1. The only restriction is that the library containing the UDFs has to be in the same Software Component Version (SWCV) as the message mapping.
    (Refer: /people/william.li/blog/2008/01/02/sap-pi-71-mapping-enhancements-series-share-user-defined-functions)
    16. Import of SQL Tableu2019s metadata
    Till now import of metadata from RFCs and IDOCs from SAP was possible but Many times, we wish we can also import metadata from SQL tables we wish to access also. This will eliminate a lot of typing and typo-mistakes. This feature is now available with PI 7.1. The only requirement is that we have to have a JDBC receiver communication channel.
    17. High volume support
    With using the Advanced Adapter Engine (AAE) in SAP NetWeaver PI 7.1, much higher numbers can be reached. For scenarios executed in the AAE, the single runtime of a message reduces by factors. Even better results can be reached for asynchronous scenarios in regards to throughput. There we see for SAP internal test scenarios the factor 10 more throughput on same hardware. The main reason for that is, that AAE can now do routing and mapping together and asynchronous messages are only persisted to the database one time.
    (Refer /people/holger.faulhaber/blog/2007/12/12/high-volume-support-in-pi-71)
    18. Additional WS standards
    Additional Ws standards have been introduced with features such as WS u2013 RM (Web services reliable messaging), WS security using SAML. Under WS-RM asynchronous messaging (EO/EOIO) and native support through integration engine (w/o adapter) is supported. Also implementation of WS security is done through SAML where there is an authorization check in receiving system based on original user.
    Rgds
    joel
    Edited by: joel trinidade on Feb 18, 2009 4:12 PM

  • About WAS and ccBPM

    What is WAS and ccBPM , what is the purpose of this components and where we can use this ones ?
    BPM and ccBPM is same or different, if different then what is that difference ?
    Edited by: Venkataramesh B on Feb 20, 2008 12:59 AM

    Hi
    WAS -SAP Web Application Server
    WAS is an incorrect shortform for SAP WebAS. If you refer to any official documentation, SAP always mentions it as SAP WebAS only. WAS is used more for websphere application server
    http://help.sap.com/saphelp_nw04s/helpdata/en/f5/81343ecc7f892ee10000000a114084/frameset.htm
    WebAS form the application platform for almost all NW components and comes in different flavors as ABAP Only / ABAP + Java / Java Only.
    ABAP + Java flavor is the one which forms the base of SAP XI and XI basically uses all the services offered by this application platform. refer help link for more details..
    http://help.sap.com/saphelp_nw04/helpdata/en/17/f1b640c9aa054fa12493e48912909c/content.htm
    There are still two types of server:
    The WebAS, part of the Netweaver product. Currenttly it's 6.4 withing NW2004, but eraly next year it's called WebAs 7 within NW2004S.
    The R/3 server, now called mySAP ERP (2005).
    Since R/3 4.7EE, the base/core for R/3 and WebAs are the same. For 4.7 it's 6.2.
    Purpose of SAP XI with SAP WebAS
    for example Adatpers :----
    All the adapters written in JAVA(EJBs) and deployed into J2EE Engine .They are JCA (Java Connector Architecture) complaint.
    Goto Communication channel > Module and check Module Name.....
    That module has written in EJBs and depolyed into J2EE Egine. You can see this module in Visual Administrator > Service > Deploy.
    This means the WebAS is supporting this J2EE Egine.
    SAP Netweaver is platform indepent means it both OS + DB independent. How it is achieving this platform indepent. That is because of WebAS.
    Earlier R2 use to run on IBM Mainframs
    R3 is running on Basis
    Now SAP Netweaver is running on WAS. WAS in nothing but basis.
    SAP Netweaver WebAS is just an extenstion of R3 BASIS
    ccBPM
    CCBPM is a solution providing to a kind of function and to signify little wider sense where integration extend across enterprise and application boundaries.
    BPM is used to implement work-flow spanning across multiple application system against embedding the parts of work-flow in application system. Apart from this it also help achive other scenarios like, bridging synch and asynch systems, alert mechanism, multi mapping etc. Check the BPM overview document in SDN download section.
    Check out the use cases discussed at http://help.sap.com/saphelp_nw04s/helpdata/en/de/766840bf0cbf49e10000000a1550b0/content.htm
    BPM is mainly used in senarios where extra functionalities are to be done with the source message which cannot be done using the normal mapping and user-defined functions, like
    -->Collecting of messages till a certain count or for a specific criteria.
    -->Merging messages
    -->Spliting messages
    -->Processing of error files and sending to specific location and sending alerts.
    -->Parallel processing of two criterias at the same time can also be done using BPM.
    some weblogs on BPM...
    /people/udo.martens/blog/2005/09/30/one-logical-system-name-for-serveral-bpm-acknowledgements
    /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
    /people/kannan.kailas/blog/2005/12/07/posting-multiple-idocs-with-acknowledgement
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm
    /people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    Integration Processes (ccBPM)
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0a1da0d-728c-2a10-62b9-f7ead58c7c00
    https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/archive-xi_ppts_internal_etc/sap%20netweaver%20rig%20webinar%20-%20cross-component%20business%20process%20management%20with%20xi%203.0.pdf
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/831620a4f1044dba38b370f77835cc/frameset.htm
    Thanks
    swarup

  • Multiple flavors of Java

    Does CFMX use the JAVA_HOME environmental variable? Also you
    can have multiple JVM’s on a machine? I have a user that
    wants Tomcat version 5.5 and Java 1.5 loaded on our CFMX servers
    and need to know if this will cause any conflicts or
    problems.

    dpstucson wrote:
    > Does CFMX use the JAVA_HOME environmental variable?
    No, it uses the JAVA_HOME variable from jvm.config.
    > Also you can have multiple JVM?s on a machine?
    Yes.
    > I have a user that wants Tomcat version 5.5 and Java 1.5
    > loaded on our CFMX servers and need to know if this will
    cause any conflicts or
    > problems.
    Just install it and point Tomcat to 1.5 and do not change
    jvm.config.
    Jochem
    Jochem van Dieten
    Adobe Community Expert for ColdFusion

  • DataFlavors in java.awt.datatransfer

    Hello
    I'm in the process of developing an application that manages the clipboard . The program runs in the "SystemTray" using the java Toolkit , on the user's request the application takes the content of the clipboard and sends it to other computers on the network that has the program and puts them in the client;s clipboard , that way the user only has to use the copy/paste functions much like if the data was resided on the computer .So far i was able to manage for pictures ,plain text and String selections , the problem is in File selections , now the "JavaFileList" flavor returns an "ArrayList" containing a String representation of the path of each file , which makes it impossible for the client to copy the content to this clipboard unless he has the same directory naming on his computer.I tried implementing a different File Selection that takes each single file as an instance of java.io.File and adds them to a vector , but still the program returns an "ArrayList" with the paths as strings ,i wanted to know should I write a new DataFlavor different than the "JavaFileListFlavor" or the error resides some where else because it worked for images , done by implementing an ImageSelection class much like the StringSelection already given by java.awt.datatransfer.
    Thank you for your collaboration.
    Edited by: Wafic1 on May 14, 2009 8:36 PM

    Strings and arrays are actually stored in the clipboard in their binary representation - and thus they can be copied easily. Files however exist as a pointer to the actual file content on the hard disk. If you copy the reference to a 4GB iso to the clipboard, you will obviously not copy the entire file.
    If you want to copy the file, you will have to do it manually. You can either store small files in the clipboard by reading them to byte[]s (implementing your own data flavor), or you can use URIs (if you have some means of the target machine accessing the source machines, such as smb or ftp).
    By the way, didn't you already post this question before?

  • Pasting Image  from Mac clipboard to Java Based Application.

    Hi,
    I am working on "iMac 10.2.7". I need to paste an image from other
    application using "Java version 1.4.1". I am trying to retrieve the image
    from the system clipboard after it is copied from some other application. I
    am pasting the code which illustrates my requirement. It works fine on
    windows. But does not work on Mac.
    On Mac it does not cross the supported data flavor check
    (clipData.isDataFlavorSupported(DataFlavor.imageFlavor) where clipData is
    the Transferable object). It seems Mac has some InputStream instead of Image
    in the clipboard when some image is copied. I tried to read that InputStream
    using ImageIO.read(java.io.InputStream). But that is also returning null.
    Thanks
    Santanu
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.awt.datatransfer.*;
    import javax.swing.*;
    public class ClipboardTest extends JFrame implements KeyListener{
         JLabel label;
         static Toolkit kit = null;
         static Clipboard clipboard = null;
         public static void main (String arg[]) {
              kit = Toolkit.getDefaultToolkit();
              clipboard = kit.getSystemClipboard();
              JLabel l = new JLabel();
              JButton button = new JButton("Paste from clipboard");
              final ClipboardTest ct = new ClipboardTest(l);
              ct.getContentPane().add(l,BorderLayout.CENTER);
              ct.getContentPane().add(button,BorderLayout.SOUTH);
              ct.setVisible(true);
         button.addActionListener(
              new ActionListener() {
                   public void actionPerformed(ActionEvent ae) {
                        pasteImage(ct.label);
         button.addKeyListener(ct);
         public ClipboardTest (JLabel l) {
              label = l;
         public static void pasteImage(JComponent jComp) {
                   jComp.setTransferHandler(new ImageSelection());
                   TransferHandler handler = jComp.getTransferHandler();
                   Transferable clipData = clipboard.getContents(null);
              if (clipData != null) {
              if (clipData.isDataFlavorSupported(DataFlavor.imageFlavor)) {
                   handler.importData(jComp, clipData);
         //Key listener methods
         public void keyPressed(KeyEvent e) {
         int c = e.getKeyCode();
         if (c == 86) {
              if (e.isControlDown()) {
                   pasteImage(label);
         public void keyReleased(KeyEvent e) {}
         public void keyTyped(KeyEvent e) {}
    class ImageSelection extends TransferHandler implements Transferable {
         /* DataFlavor instance that holds imageflavor value*/
         private static final DataFlavor flavors[] = {DataFlavor.imageFlavor};
         private Image image;
         public boolean importData(JComponent comp, Transferable transferable) {
         try {
         if (transferable.isDataFlavorSupported(flavors[0])) {
         image = (Image)transferable.getTransferData(flavors[0]);
                   if (comp instanceof JLabel) {
                   ((JLabel)comp).setIcon(new ImageIcon(image));
                   comp.repaint();
                   return true;
         } catch (Exception ignored) {
              ignored.printStackTrace();
         return false;
         // Transferable Interface methods
         public Object getTransferData(DataFlavor flavor) {
         if (isDataFlavorSupported(flavor)) {
         return image;
         return null;
         public DataFlavor[] getTransferDataFlavors() {
         return flavors;
         public boolean isDataFlavorSupported(DataFlavor flavor) {
         return flavor.equals(flavors[0]);

    Here are two commercial options:
    JTwain + JSane
    http://asprise.com/product/jtwain/index.php
    Morena
    http://www.gnome.sk/Twain/jtp.html
    Haven't tested them, so don't no how good they are, nor how easy they are to use on multiple platforms.

  • Customised Flavor Drag and Drop in Indesign CS3

    Hello All,
    I'm implementing a to Drag & Drop from an external application (say windows Desktop) on to Indesign CS3 Document. I have implemented a Custom Flavor helper and a Data Exchange helper for my custom Flavor.
    I have registered my Custom Flavor in Constructor of My Custom Flavor
    RegisterExternalFlavor(TEXT("Portable Document Format"));
    In the Function CouldAcceptTypes, it is
    if (dataIter != nil)
    // Test for swatches in the drag
    DataExchangeResponse response;
    response = dataIter->FlavorExistsWithPriorityInAllObjects(kPDFExternalFlavor);
    bool16 valid = response.CanDo();
    if (valid)
    return DragDrop::TargetResponse(response, DragDrop::kDropWillCopy);
    return DragDrop::kWontAcceptTargetResponse;
    Now My Problem it is this variable "valid" is always False. So it is not going inside the loop. and hence I am not getting call in ProcessDragDropCommand. The Only calls which I am getting is in
    DataExchangeHandler::CreateScrapStorage() & DataExchangeHandler::GetFlavor()
    Note that I am dropping PDF only. I suppose the problem is in dropped Flavor only that it is not accepting.
    Kindly help.
    I am stuck at this point.
    ..Many Thanks

    From the Swing tutorial check out this section on [url http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html#customComp]Data Transfer With a Custom Component.
    The [url http://java.sun.com/docs/books/tutorial/uiswing/misc/example-1dot4/index.html#DragPictureDemo]Drag Picture Demo has the code I think you are looking for. Specifically the PictureTransferHandler.java class.
    a) In the createTransferable() method the source component is saved
    b) In the importData() method the source and target component are compared. When they are the same you exit immediately and set a "shouldRemove" boolean.
    c) In the exportDone() method your check the action and the shouldRemove boolean before doing anything.

  • How do i use java printing api 1.4

    How can i print documents using jdk1.4 api.
    I have used the following program for printing.
    import java.io.*;
    import java.awt.*;
    import java.awt.print.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    public class Print2DtoStream implements Printable{
    public Print2DtoStream() {
    /* Use the pre-defined flavor for a Printable from an InputStream */
    DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
    /* Specify the type of the output stream */
    String psMimeType = DocFlavor.BYTE_ARRAY.POSTSCRIPT.getMimeType();
    /* Locate factory which can export a GIF image stream as Postscript */
    StreamPrintServiceFactory[] factories =
    StreamPrintServiceFactory.lookupStreamPrintServiceFactories(flavor, psMimeType);
    if (factories.length == 0) {
    System.err.println("No suitable factories");
    System.exit(0);
    try {
    /* Create a file for the exported postscript */
    FileOutputStream fos = new FileOutputStream("out.ps");
    /* Create a Stream printer for Postscript */
    StreamPrintService sps = factories[0].getPrintService(fos);
    /* Create and call a Print Job */
    DocPrintJob pj = sps.createPrintJob();
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    Doc doc = new SimpleDoc(this, flavor, null);
    pj.print(doc, aset);
    fos.close();
    } catch (PrintException pe) {
    System.err.println(pe);
    } catch (IOException ie) {
    System.err.println(ie);
    public int print(Graphics g,PageFormat pf,int pageIndex) {
    if (pageIndex == 0) {
    Graphics2D g2d= (Graphics2D)g;
    g2d.translate(pf.getImageableX(), pf.getImageableY());
    g2d.setColor(Color.black);
    g2d.drawString("example string", 250, 250);
    g2d.fillRect(0, 0, 200, 200);
    return Printable.PAGE_EXISTS;
    } else {
    return Printable.NO_SUCH_PAGE;
    public static void main(String args[]) {
    Print2DtoStream sp = new Print2DtoStream();
    However when i run this program,it prints "example string" as used in g2d.drawString("example string",250,250) method above.
    What if i want to print content from any file.
    So anybody konwing this plz reply

    This is covered pretty well in the Java Print Service API Guide.
    You could start here http://java.sun.com/j2se/1.4.1/docs/guide/jps/spec/printing.fm1.html
    Basically, you have two choices - either you're going to throw a document at the print service, or you're going to print using Graphics2D commands. You also have the choice between printing to a printer, or to a stream. Mix and match for four combinations.
    Whether you can just take a raw document and send it to a printer via the document printing stuff depends on what print services you have installed. For the standard J2SE, it's pretty limited.
    If you're doing it via the Graphics2D approach, however, you can print anything you can draw. That's nice - it means you can use the same code to display stuff on the screen and print it.

  • Exception in thread "main" java.lang.NoClassDefFoundError: example2

    Ok, I have done some java programming before, and it used to work fine on my pc. I have deleted every piece of java off my machine and replaced it and I still get the same error. I have a simple program:
    import java.io.*;
    public class example2
    static BufferedReader keyboard = new
    BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException
    String flavor; //variable to hold buyer's chosen flavor
    int gallons; //variable to hold number of gallons purchased
    float price = 0.0F; //just 0.0 would be a double, can't store in float
    System.out.println("Would you like chocolate or strawberry?");
    flavor = keyboard.readLine();
    System.out.println("How many gallons would you like?");
    gallons = Integer.parseInt(keyboard.readLine());
    //why? readLine() gives String, need to convert to int
    if(flavor.equals("chocolate")){
    price = gallons * 5.59F;
    } else {
    price = gallons * 4.89F;
    System.out.println("Total price for " + gallons + " gallons of "
    + flavor + " ice cream is $" + price);
    and then I run it :java example2
    and get the same error over and over again. But, if i goto my colloge - and do the same thing om a diff pc, I works just fine. I am running 1.4.1_01 and am just going nuts. Bug maybe?? any takers..
    Gerald Pottier

    float price = 0.0F; //just 0.0 would be a
    be a double, can't store in float
    if(flavor.equals("chocolate")){
    price = gallons * 5.59F;
    } else {
    price = gallons * 4.89F;
    }Does float normally have letters at the end?
    maybe you can do a type cast
    float price = (float) 0.0;
    How does java know what * 5.59F is?
    how does it know that it's the same as 5.59? isn't 5.59F a String?
    It's not a retorical question.. could you explain how java knows?
    I looked at your example, and looked up 'float' in my java book, which doesn't say about putting letters/currency symbols at the end of a number in a float. I only wanted to know if it is possible? (I'm new so I can't answer your questions, sorry, I didn't understand that bit of your example).

  • How to print an Doc file(MS Word File)on a printer in JAVA

    Hi.I am Prakash.
    Folowing is the code that i have used to print an doc file on a printer. Problem is that , when i run this code it will provide me an printout of a doc file.,but not in well formate as the actual formate of the file. If any one tried this before plz help me.Thanks
    import java.lang.reflect.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Graphics2D;
    import java.io.*;
    import javax.swing.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    import javax.print.event.*;
    public class BasicPrint {
         JFrame frame;
         JButton btn;
         private boolean PrintJobDone = false;
         protected void MakeGui() {
              frame = new JFrame("PrintService");
              btn = new JButton("Cancel Print Job");
              btn.disable();
              frame.getContentPane().add(btn, BorderLayout.SOUTH);
              frame.pack();
              frame.setVisible(true);
         BasicPrint(String FileToPrint, String pMode) {
              try {
                   MakeGui();
                   File baseDir = new File("d:/doc");
    File outDir = new File(baseDir, FileToPrint);
                   // Open the image file
                   InputStream is = new BufferedInputStream(new FileInputStream(
                             outDir));
                   // Find the default service
                   DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   //DocFlavor flavor = new DocFlavor("application/msword", "java.io.InputStream");
                   //DocFlavor docFlavor = new DocFlavor("application/vnd.ms-word", "java.io.InputStream");
                   if (pMode != null && pMode.equalsIgnoreCase("PS"))
                        flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
                   else if (pMode != null && pMode.equalsIgnoreCase("PDF"))
                        flavor = DocFlavor.INPUT_STREAM.PDF;
                   else if (pMode != null && pMode.equalsIgnoreCase("JPG"))
                        flavor = DocFlavor.INPUT_STREAM.JPEG;
                   else if (pMode != null && pMode.equalsIgnoreCase("GIF"))
                        flavor = DocFlavor.INPUT_STREAM.GIF;
                   else if (pMode != null && pMode.equalsIgnoreCase("PNG"))
                        flavor = DocFlavor.INPUT_STREAM.PNG;
                   else if (pMode != null && pMode.equalsIgnoreCase("PCL"))
                        flavor = DocFlavor.INPUT_STREAM.PCL;
                   else if (pMode != null && pMode.equalsIgnoreCase("RAW"))
                        flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT16"))//****                                   *********
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16;
                        System.out.println("****ACTIVE***");
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTBE"))//****
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16BE;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTHOST"))//***
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_HOST;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXT8"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_8;
                   else if (pMode != null && pMode.equalsIgnoreCase("TXTASCI"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
                   else if(pMode != null && pMode.equalsIgnoreCase("TXTLE"))
                        flavor = DocFlavor.INPUT_STREAM.TEXT_PLAIN_UTF_16LE;                                        //*******
                   else if(pMode != null && pMode.equalsIgnoreCase("SEVICE"))
                        flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
                   String type = flavor.getMediaType();
                   System.out.println("Type ="+ type);
                   //IMPRIMIR prakashCV.doc TXT text/plain; charset="utf-16le"; class="java.io.InputStream"
                   System.err.println("* IMPRIMIR " + FileToPrint + " " + pMode + " "
                             + flavor);
                   PrintService dservice = PrintServiceLookup
                             .lookupDefaultPrintService();
                   PrintService[] services = PrintServiceLookup.lookupPrintServices(
                             flavor, null);
                   if (services == null || services.length < 1)
                        services = PrintServiceLookup.lookupPrintServices(null, null);
                   PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
                   aset.add(new Copies(1));
                   aset.add(OrientationRequested.PORTRAIT);
                   // aset.add(MediaTray.MAIN);
                   aset.add(Sides.ONE_SIDED);
                   aset.add(MediaSizeName.ISO_A4);
                   PrintService service = ServiceUI.printDialog(
                             (GraphicsConfiguration) null, 60, 60, services,
                             (PrintService) dservice, (DocFlavor) flavor, aset);
                   if (service != null) {
                        // Create the print job
                        final DocPrintJob job = service.createPrintJob();
                        Doc doc = new SimpleDoc(is, flavor, null);
                        // Monitor print job events; for the implementation of
                        // PrintJobWatcher,
                        PrintJobWatcher pjDone = new PrintJobWatcher(job);
                        if (job instanceof CancelablePrintJob) {
                             btn.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       CancelablePrintJob cancelJob = (CancelablePrintJob) job;
                                       try {
                                            cancelJob.cancel();
                                       } catch (PrintException e) {
                                            // Possible reason is job was already finished
                             btn.enable();
                        try {
                             // Print it
                             job.print(doc, (PrintRequestAttributeSet) aset);
                        } catch (PrintException e) {
                             e.printStackTrace();
                        System.err.println("* Impresion Realizada - Esperando ..");
                        // Wait for the print job to be done
                        pjDone.waitForDone();
                   // It is now safe to close the input stream
                   is.close();
              } catch (IOException e) {
                   e.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   try {
                        synchronized (BasicPrint.this) {
                             PrintJobDone = true;
                             BasicPrint.this.notify();
                   } catch (Exception e) {
                        e.printStackTrace();
         public synchronized void waitForDone() {
              try {
                   while (!PrintJobDone) {
                        wait();
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              try {
                   //args[0]="t";
                   //args[1]="rr";
    //               if (args.length < 1) {
    //                    System.err.println("\nSintaxis:\n\n java BasicPrint FileToPrint [pMode]\n");
    //                    System.exit(0);
                   BasicPrint bp = null;
                   //if (args.length < 2){
                        //bp = new BasicPrint(args[0], null);
                   //}else{
                        //bp = new BasicPrint(args[0], args[1]);
                        bp = new BasicPrint("prakashCV.doc","SEVICE");                                                       //****/***
                   bp.waitForDone();
                   System.exit(0);
              } catch (Exception e) {
                   e.printStackTrace();
         class PrintJobWatcher {
              // true iff it is safe to close the print job's input stream
              boolean done = false;
              int lastEvent = 0;
              PrintJobWatcher(DocPrintJob job) {
                   // Add a listener to the print job
                   job.addPrintJobListener(new PrintJobAdapter() {
                        public void printJobRequiresAttention(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* La impresora requiere de su Atencion ! * "
                                                 + pje);
                             // allDone();
                        public void printDataTransferCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* Transferencia de datos a la impresora OK. * "
                                                 + pje);
                             // allDone();
                        public void printJobCanceled(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Trabajo de impresion CANCELADO ! * "
                                       + pje);
                             allDone();
                        public void printJobCompleted(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* Impresion completa OK. * " + pje);
                             allDone();
                        public void printJobFailed(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err.println("* ERROR en la Impresion ! * " + pje);
                             // allDone();
                        public void printJobNoMoreEvents(PrintJobEvent pje) {
                             lastEvent = pje.getPrintEventType();
                             System.err
                                       .println("* No mas eventos de impresion * " + pje);
                             allDone();
                        void allDone() {
                             synchronized (PrintJobWatcher.this) {
                                  done = true;
                                  PrintJobWatcher.this.notify();
              /** Description of the Method */
              public synchronized void waitForDone() {
                   try {
                        while (!done) {
                             wait();
                   } catch (InterruptedException e) {
                        e.printStackTrace();
    }

    Hi Maxpkh
    Do you mean attachment? You can't do that with free Adobe Reader you need Acrobat to do this.
    ~Deepak

  • Help - I cannot set the Default Java for Browsers

    Hello:
    I'm running Win 7, the Home Premium, 64 bit flavor. I have IE 8 and FF 3.5.8 installed. FF is the default browser. I've installed Java and when I go to the test page: http://www.java.com/en/download/help/testvm.xml
    I get a message which says: "Something is wrong. Java is not working."
    HOWEVER, if I open a command prompt and type java -version, I get this:
    C:\Users\dogzilla>java -version
    java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode)
    So I went to the control panel app, the advanced tab, and expanded the node for Default Java for Browsers. I have 2 problems.
    1. The checkbox for Microsoft Internet Explorer is greyed out; I cannot change any settings here at all.
    2. I checked the checkbox for Mozilla Family. Then, when I click OK, I get an error message which states:
    "Unable to change browser settings. Please check that Mozilla or Firefox or Netscape is properly installed on the system and/or that you have sufficient permissions to change system settings."
    Since I'm writing this message to the forum using FF, I'm going to guess that I have the browser installed correctly. So that leaves me with a permissions problem -- which I don't doubt. I have no idea where to start looking though. Especially considering I can run the files in the bin directory from a command line without any problems.
    Does anyone know how I can solve the two problems I described in this thread? Suggestions are greatly appreciated.
    Thanks!

    Thanks for the reply!
    I tried running as admin and no luck. Still experiencing the same problems.
    I've did some more reading (much more in fact for what this problem should be worth) and other forums mention that on 64 bit Windows systems, both the 32 bit and 64 bit JRE need to be installed.
    When I was running Win XP, I could just download the SDK, create an environment variable, and I was good to go. Now, it looks like if I just install the SDK, I need the JRE plugin download for just the browsers -- what a ridiculous waste/duplication!
    Thanks again for your help.

  • How to print  Excel file in java?

    Hi, all
    I had written a program to generate a Report with Excel in java using the jexcelapi_2_5_7 . But I don't know how to print it in java program. It seems that java print Service don�t support Excel flavor. How should I do? It will be a great appreciate for me if anyone could help me.
    Regards
    David

    Hi ,
    i m asking if you got a solution for your problem ;
    i need solution to the same problem
    thx in advance

  • Simple java question, help please

    please help
    -i am just starting out in java and im havin an early problem. Im trying to run a small java script from a commant prompt but im getting the following error after i enter this command at my prompt
    c:\javatest>javac HelloARP.java
    javac is not as an internal or external command, operable program or batch file.
    when i enter
    c:\java -version
    i get the following message: registry key software\javasoft\java runtime enviornment\current version has value of 1.1 but 1.4 is requiured
    error: could not find java.dll
    error: could not find java 2 runtime enviornment
    -im sure this is a simple error on my part. all im trying to do is run my first lil program that i saved in notepad, its only 5 lines long. here is the lil test program im trying to execute
    class HelloARP {
    public static void main (String[] arguments) {
    System.out.println("What's good ARP?");
    - all responses and help are welcomed. Thank you ahead of time for anyone that can help me get started.

    Hi
    First of all uninstall your current JDK installation, if you can get to the registry delete the registry entries for the old version of java which was there on your machine.
    Now do a fresh install of your j2sdk1.4.1, make sure that you will install the JRE with the J2SDK1.4.1.
    Once you are done, set your classpath in autoexec.bat if you are using Windows 95/98
    or set your environment variables if you are using Win NT/2000/XP.
    If using solaris or other unix flavors see the included installation instructions provided.
    Let me if you face the same problem.
    Thanks
    Swaraj

Maybe you are looking for

  • Using a DAQ value in a location outside of the While Loop it is placed in

    I am writing a program that records the speed of a car and then is supposed repeat the action through the use of an actuator.  I was able to write the program to the point where I am saving the data into a .txt file and will be able to read it back o

  • Cost center line items by profit center

    Hi, We have an issue, where user has processed a document in FI with profit center "X" however the cost center of the document has profit center "Y" in the master data. In FI, accounting document showed against the profit center "X" with which user h

  • Can't license my Photoshop Elements 12

    Hi, I've bought Photoshop Elements 12 online in the Adobe shop. They send me the serial by mail. But when i try to license my trial version of elements 12, i always get this message: "This serial number for Adobe Photoshop Elements 12 could not be ch

  • Transferring Cash account to PCA in Classic PCA

    Hi Is is possible to transfer cash account to Profit Centers in Classic PCA.  If i have the following entry : DR        Primary Cost Element CR        Cash Can i transfer the Cash a/c to PCA based on the Primary Cost element.  If yes, what are the co

  • HT3702 My 10 year old has spent £721.77 on my iTunes account in the past week. HELP!!!!

    I have just found out my 10 year old has spent £721.77 on my iTunes account in the last 6 days. My bank can't help me and there is no one available from Apple to help me at all. What on earth am I going to do? Am in tears here. I am a single mother a