1.4.2 - What is the correct way to format output in the java.io.PrintStream

With Java 1.4.2:
What is the correct way to format output in the java.io.PrintStream?
The following is incorrect, even though it is still used in the The JavaTM Tutorial at: http://java.sun.com/docs/books/tutorial/essential/
System.out.formatThis returns "cannot resolve the method 'format'"
Any detailed suggestions or information is greatly appreciated.

The following is incorrect, even though it is still
used in the The JavaTM Tutorial at:
http://java.sun.com/docs/books/tutorial/essential/
The whole format thing has been introduced in 1.5. The tutorial also states it's been "updated to 1.5.".
That's all I've got to say for I don't know how you can format a PrintWriter, let alone a PrintStream, prior to 1.5. I'm not really sure there is any way. Any "legacy way", that is. There almost certainly are third-party API which achieve similar results.

Similar Messages

  • What is the correct way to format file paths and names in the structapp file?

    I am trying to create a structured application to export fm files as xml, and probably read the xml back to fm.
    In the structured application file (structapp), I need to specify the locations of the various files (DTD, read/write, template, etc). I would like to place these files on a shared server so others can use the same structapp file (that is, a cop of it). What is the correct way to format the file paths and names? Can folders folder names and file names have spaces in them? I tried the following, for example:
    \\serverName\shareName\folder 1\folder 2\file name.dtd
    I use the same format for the template file and the read/write rules file.
    When I try to save an fm file to xml, FrameMaker says that it cannot read the DTD; however, the resulting xml file appears to be well-formed. The DOCTYPE element in the resulting xml is formatted with forward slashes and spaces replaced with %20.
    I tried using forward slashes and replacing spaces with %20, but then I get an error about reading the read/write rules.
    NOTE: I have another structured application to read xml into fm. This application does not have a DTD file. The template and read/write rules files are specified as above. Except for complaining about a lack of a DTD, the application works fine; it even applies an XSLT in the process. Again, when I DO add a DTD to this latter application, I get the same complaint about not being able to read the DTD.
    I am using fully patched FrameMaker 9 in Windows XP.
    Thanks,
    Van

    Hi Van,
    The XML parser and FrameMaker are not the same thing. The Error Log says which component created which message. The XSL processor is another option that can throw messages. The "\\server\path\some.dtd" syntax in structapps.fm seems to be fine for some tools, as Internet Explorer with XML tools successfully finds the DTD which appears as "//server/path/some.dtd" in the XML. But apparently Xerxes, the XML parser bundled with FrameMaker, does not like this notation.
    If you have a path with a drive letter, "H:\path\some.dtd", FrameMaker turns that into "file:///H:/path/some.dtd". It seems, Xerces would like to see "file:/" in front of absolute paths.
    This is what I have in structapps.fm:
    Template: \\server\path\projecttemplate.fm
    DTD: some.dtd
    Read/write rules: \\server\path\projectrules.txt
    DOCTYPE: …
    Entity locations
      Entity search paths
        1: \\server\path\
    In the structapps.fm I have the DTD without path information. The resulting XML (without XSL postprocessing) then contains just the file name with a relative path back to the book folder (when saving a book as XML). It therefore requires the DTD to be available at this place. I handle this using an event script that fires for NotePreSaveXml and copies the DTD to the folder of the original document.
    As I always use XSL postprocessing and using XSLT1 it is not possible to have the doctype-system as a parameter I have this in my XSL stylesheet:
    <xsl:output doctype-system="some.dtd" />
    For the resulting XML the DTD is expected to be in the same folder as the XML file. This is handled by the same event script as above, it therefore copies the DTD to the source and the target folder.
    Bottom line: If you want/have to use UNC paths, you have to do some programming to work around a FrameMaker bug.
    - Michael

  • What are the java components?

    hi iam new to this it field. this is the question asked by interviewer. so please help me.
    what are the java components you can use in a webproject? how you use those components in your project?

    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/

  • What is the Java runtime version required for SAP GUI 6.20 for Windows?

    Hi All,
    I need the following information:
    1.       What is the Java Runtime version required for SAP GUI version 6.2 for Windows (Platform Windows XP)?
    2.       And is there any problem if we use Java runtime version 1.6 on PC?
    It would be great if anybody can provide the information on the above.

    To run SAP GUI for WIndows -- Java isnt a pre-requisite nor is there any dependency for the same.
    Thanks,
    GLM

  • What is the Java Library Path?

    Hi,
    I have a Java package that I need to add to my computer. The instillation information that I received with this package is as follows:
    * For this package to function, you must modify your java library path
    (the "java.library.path" property) or you must copy <WInterface.dll> to
    a directory that is already on that path.
    My questions are
    1). What is the java.library.path?
    2). How do I determine what the path is for my computer,
    3). And finally how do I modify this path?
    Thanks for your assistance.

    1) It is the list of paths to search when loading libraries.
    2) That can be found out with this program:public class PrintLibraryPath {
        public static void main(String[] args) {
            System.out.println(System.getProperty("java.library.path"));
    }3) By giving the java launcher the command line argument "-Djava.library.path=yourpath".

  • What is the java console?

    what is the java console and why do i see a little java logo in my sys tray when i start netscape 6, but not when i start ie5?
    thanks,
    erik

    The Java Console is where output to System.out and System.err goes when you run an applet in a browser. It's the first place to look when you have trouble running an applet, because it will show the exception and stack trace information.
    Netscape 6 uses the Java Plug-In to provide Java 2 support, but IE has native JDK 1.1 support. The Java logo appears when you use the Java Plug-In.

  • What is the java threat?

    What is the jave threat and how do you remove it?

    I am not sure but the Version of Java that is affected is 7 not 6. I could be wrong as I only heard about this half an hour ago.
    This ZDNET article mentions only Java 7, http://www.zdnet.com/homeland-security-warns-to-disable-java-amid-zero-day-flaw- 7000009713/
    I am on 10.8.2. My Xprotect.plist was updated in Jan 11 2013 as per the location it can be found under, /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources. I am running Java 7 Update 10 as per Java System Preferences.
    When I try to install Java 7 Update 11 I get an error.
    "Update Error
    An error occurred while downloading the update. Please try again later."
    All I can do is click Cancel.
    I will download the Java 7 Update 11 manually to see what is up. I cannot restart now as a troubelshooting step.
    I installed Java 7 Update 11 manually via the link, http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.h tml
    The manual update installed fine and the Java Control Panel reports I am running the recommended verison of Java.
    I don't use Java anyway, I use Safari and have it turned off from Safari Preferences but I know some of you out there depend on it like you depend on water.

  • What's the correct way to format lists?

    Is it like this?
    Here is my list:
    * Item 1
    * Item 2
    * Item 3
    Or like this?
    Here is my list:
       * Item 1
       * Item 2
       * Item 3
    That is, with or without the initial bullet indent?
    Much obliged!

    There is no correct way. The only thing that (to me) is incorrect is with numbered lists, where you want to have the numbers right aligned, so that 9 and 10 line up with the 9 directly over the 0 of 10. I prefer to have hanging bullets (or numbers), and in the case of bullets, an indent of an en or so. In numbers, I prefer to see the numbers indent an en for single digit numbers, and no indent for the two digit ones. If the list is long with 1 digit going up to three digits, I will switch on a later page, so that the two digit numbers will have an en space before, allowing space for the third digit later on that page.
    But there are no rules. It is entirely design esthetics.

  • What is the Java Development Toolkit?

    I have been playing Pogo.com for 6 years, however, the last 2 weeks I am/was not able to play a game. They said to adjust computer settings, I did. They said contact my security, I did. Now, they say to install the Java Development Toolkit.
    What do I do?
    Please help.

    You may be looking for this: [http://www.oracle.com/technetwork/java/javase/downloads/jdk7u7-downloads-1836413.html]
    Then restart Firefox :-)

  • What is the Java default ORB implementation class?

    I have a web application deployed on the Sun Java System Application Server 8. This application will also act as a CORBA client by invoking remote methods on another CORBA server.
    Our first approach was to use the ORB provided by the Sun App Server. But whenever the code reaches the point to initialize the ORB:
    orb = ORB.init(as, null); we encountered such exceptions:
    [#|2005-02-03T00:38:43.912-0600|WARNING|sun-appserver-pe8.0.0_01|javax.enterpris
    e.resource.corba._DEFAULT_.rpc.transport|_ThreadID=14;|"IOP00710209: (INTERNAL)
    Unable to create listener thread on the specific port"                         
    org.omg.CORBA.INTERNAL:   vmcid: SUN  minor code: 209  completed: No  
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFa
    iled(ORBUtilSystemException.java:3142)                                         
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.createListenerFa
    iled(ORBUtilSystemException.java:3160)     When we deployed the same app on Tomcat, it worked fine. We later reasoned the exception was happening on the Sun App Server because perhaps it was trying to initialize another ORB with the same properties as the one initialized by the Sun App Server, and thus was trying to create another listener on a port already in use.
    On tomcat, the ORB used was the default ORB provided by Java. Thus, we thought we would try 'overriding' the ORB properties for the Sun App Server by specifiying this in the ORB.init() method:
            String as[] = null;
         Properties orbProperties = new Properties();
         orbProperties.put("org.omg.CORBA.ORBClass","com.sun.corba.se.internal.iiop.ORB");
         orbProperties.put("org.omg.CORBA.ORBSingletonClass","com.sun.corba.se.internal.iiop.ORB");
            orb = ORB.init(as, orbProperties);But when executing this, we get the exception as follows:
    Caused by: org.omg.CORBA.INITIALIZE: can't instantiate custom socket factory: co
    m.sun.enterprise.iiop.IIOPSSLSocketFactory  vmcid: 0x0  minor code: 0  completed
    : No                                                                           
            at com.sun.corba.se.internal.corba.ORB.parseProperties(ORB.java:1250)  
            at com.sun.corba.se.internal.POA.POAORB.parseProperties(POAORB.java:267)
            at com.sun.corba.se.internal.Interceptors.PIORB.parseProperties(PIORB.ja
    va:341)                                                                        
            at com.sun.corba.se.internal.corba.ORB.set_parameters(ORB.java:460)    
            at com.sun.corba.se.internal.POA.POAORB.set_parameters(POAORB.java:153)
            at com.sun.corba.se.internal.Interceptors.PIORB.set_parameters(PIORB.jav
    a:333)                                                                         
            at org.omg.CORBA.ORB.init(ORB.java:337)                                
            at com.covansys.ipceuc.corbalogic.SessionManager.<clinit>(SessionManager
    .java:159)      Some Sun sites mentioned that com.sun.CORBA.iiop.ORB is the Java ORB implementation. When trying to use this, we got a ClassNotFoundException.
    Also tried the following classes:
    com.sun.corba.se.internal.corba.ORB
    com.sun.corba.se.internal.core.ORB
    com.sun.corba.se.internal.org.omg.ORBAll of them reported exceptions as follows:
    Caused by: org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementati
    n org.omg.CORBA.ORB  vmcid: 0x0  minor code: 0  completed: No                 
            at org.omg.CORBA.ORB.create_impl(ORB.java:297)                        
            at org.omg.CORBA.ORB.init(ORB.java:336)                               
            at com.covansys.ipceuc.corbalogic.SessionManager.<clinit>(SessionManage
    .java:158)                                                                    
            ... 55 more                                                           
    Caused by: java.lang.InstantiationException                                   
            at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstanc
    (InstantiationExceptionConstructorAccessorImpl.java:30)                       
            at java.lang.reflect.Constructor.newInstance(Constructor.java:274)    
            at java.lang.Class.newInstance0(Class.java:308)                       
            at java.lang.Class.newInstance(Class.java:261)                        
            at org.omg.CORBA.ORB.create_impl(ORB.java:295)                        
            ... 57 more                                                           
    |#]                                                                            Anyone know what the Java ORB implementation class is, or whether this is possible at all?
    Thanks in advance.

    Hello
    The defaults for JDK 1.4.2 (at least) are shown it the code below:
            Properties p = new Properties ();
            p.put ("org.omg.CORBA.ORBSingletonClass",
                   "com.sun.corba.se.internal.corba.ORBSingleton");
            p.put ("org.omg.CORBA.ORBClass",
                   "com.sun.corba.se.internal.Interceptors.PIORB");
            p.put ("javax.rmi.CORBA.UtilClass",
                   "com.sun.corba.se.internal.POA.ShutdownUtilDelegate");
            p.put ("javax.rmi.CORBA.PortableRemoteObjectClass",
                   "com.sun.corba.se.internal.javax.rmi.PortableRemoteObject");
            System.setProperties (p);Of course you can use this code to set these defaults back. Be careful, if you do this inside Weblogic, for instance, it will likely abend.
    []'s
    Marcond

  • What caused the "java.lang.OutOfMemoryError (no stack trace available)"?

    We just met another problem: after I modified the BDM file on TUXEDO and bdmconfig.xml
    file on WEBLOGIC (with no ACL or authentication setup on both side), when I booted
    up the WebLogic 6.1 server, the ULOG file of Tuxedo says that the connection has
    been set up, however, I got the "java.lang.OutOfMemoryError (no stack trace available)"
    on the WebLogic side. I tried to enlarge the Java heap size even to 1024m, but it
    has no use. If I delete the WTC setting then WebLogic works fine.
    Could somebody helps me on this? Because we have a very tight schedule on development,
    I do appreciate your quick response.
    Thanks!
    Bill

    Hi,
    I am getting same OutofMemoryError. I could not understand change in bdmconfig.xml
    removed the outofmemory error.
    what is bdmconfig.xml file and you specified port#?
    I could not able to see any port # in the config.xml...
    any help is appreciated.
    RajKumar
    "Bill Yuan" <[email protected]> wrote:
    >
    Bob,
    Another expert in our company told me that we should use a different
    PORT# (kind
    of DUMMY port) in the bdmconfig.xml file on WebLogic side, instead of
    the real WebLogic
    instance PORT#. We tried and the OutOfMemoryError disappeared, and the
    WTC connection
    works OK. We don't know why should we do this, maybe it is a bug or some
    hardware
    requirement.
    Anyway, thank you very much for your help and quick respondse!
    have a good day!
    Bill
    Bob Finan <[email protected]> wrote:
    Bill,
    Check the logs to see if the out of memory is the only execption orif
    it is the last exception. It could be that there is something happening
    earlier on that you are missing.
    There are also other JVM problems that can arise besides the heap
    size. The Hotspot VM had an issue where you needed to set a maximum
    permanent generation size( helps garbage collection tuning I think).
    (-XX:MaxPermSize=32m for jdk130,64m for jdk131). It comes into
    play when you are loading many classes.
    Bob Finan
    Bill Yuan wrote:
    Bob,
    Thanks! We didn't set MTYPE in both BDMCONFIG files in Tuxedo and
    WebLogic
    sides.
    From the WTC document and Tuxedo document, it says that if MTYPE is
    not
    specified,
    the default is to turn ENCODING/DECODING on. Do you see any other
    possibilities?
    Thanks!
    Bill
    Bob Finan <[email protected]> wrote:
    Bill,
    One possible reason is if MTYPE is set, in the DMCONFIG on the
    Tuxedo side, as part of your remote domain definitions of the WTC
    domain. This should not be set or set it to NULL. This problem occurs
    because encoding/decoding is always needed between java and non-java
    domains.
    Bob Finan
    Bill Yuan wrote:
    We just met another problem: after I modified the BDM file on TUXEDO
    and
    bdmconfig.xml
    file on WEBLOGIC (with no ACL or authentication setup on both side),
    when
    I booted
    up the WebLogic 6.1 server, the ULOG file of Tuxedo says that the
    connection
    has
    been set up, however, I got the "java.lang.OutOfMemoryError (no
    stack
    trace available)"
    on the WebLogic side. I tried to enlarge the Java heap size even
    to
    1024m,
    but it
    has no use. If I delete the WTC setting then WebLogic works fine.
    Could somebody helps me on this? Because we have a very tight scheduleon development,
    I do appreciate your quick response.
    Thanks!
    Bill

  • What  are the Java SE contents exactly? please guide me?

    hello every body,
    I just want to know what are the contents that are applicable for java SE?
    please give me the all the cointents ,
    does web applications ,servlets,hibernate ,ejb all these are part of java SE?
    please give me all the list of concepts?
    thanking you,
    regards
    siva kiran.B

    Here:
    http://java.sun.com/javase/6/docs/
    It's got a nice graphics right at the top that mentions most (if not all) of the content of JSE (f.k.a J2SE).
    Web applications, servlets, ejb are not part of JSE, they are part of JEE (which builds on JSE).
    Hibernate is neither part of JSE, nor of JEE, it's a third party library. It can be used with both JSE and with JEE.

  • What are the Java libraries for RFID

    I need to know the Java classes implemented in RFID infrastructure for processing data and events between readers and tags?

    Hi,
    You can install the Java proxy runtime on the SAP J2EE Engine Release 6.40 SP5 or higher.
    The messaging system that the Java proxy runtime uses to send messages to the Integration Server must also be installed on the J2EE server.
    To send messages from a J2EE application, the application must be programmed against beans that encapsulate all details about the Java runtime. The following classes are generated:
    ·        Proxy classes that send or receive messages using the Java proxy runtime.
    ·        Bean classes as an outer shell that conform to the J2EE standard. The beans call the proxy classes for communication.
    The classes must be deployed on the J2EE server together with their J2EE application
    see this link for the example scenario http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7eb8903501d

  • What is the Java equivalent to Windows SystemMetrics?

    Hello,
    I would like to retrieve component metrics on items such as titlebar height, horizontal scrollbar height, default font etc.
    Unfortunately, I want to know the information without neccessarily having an instance of the control type visible (ie I want to know how high my forms titlebar will be before I create the form).
    The reason I need this is to feed information back to a third party product that requires the type of details that you could query from the SystemMetrics available in Windows.
    The tricky part is that the windows app needs to know these details before the Java app has created its first form.
    Any help would be much appreciated,
    thankyou, Sean.

    thankyou camickr,
    that link was very useful - please have the dukes.
    one thing that the link code doesn't give details about is how to find the metrics on the top level containers. Do you have any suggestions?

  • What's the JAVA equavelent  of "R3trans -d"?

    Hi!
    On the ABAP side, "R3trans -d" is a very useful tool to diagnose connection errors.
    Is there an equavelent of "R3trans -d"  for the JAVA stack?
    Thanks a lot!!

    Hi CZ,
    Please try the following link..
    SICK Transaction on JAVA-Stack
    I hope this may help you.
    Thanks,

Maybe you are looking for