Can't get console up and running in eclipse

Hi tried to get the system.console() up with a console object, using code from java tutorial, here: http://java.sun.com/docs/books/tutorial/essential/regex/test_harness.html
But when I try to run the code, the console never pops up and the return is null. I am using eclipse with java 1.6 installed. I have programmed on this with many other classes before and have not had a problem.
I am using the fall 07 version of eclipse on windows vista home premium.
Please advise
Thanks
-Z
Edited by: zhuberg on Aug 16, 2008 9:19 PM
Edited by: zhuberg on Aug 16, 2008 9:22 PM

Hi tried to get the system.console() up with a console object,Do you mean you invoked System.console()? If so, you should take the [API docs|http://java.sun.com/javase/6/docs/api/java/lang/System.html#console()] at face value: "Returns the unique Console object associated with the current Java virtual machine, if any". If any.
If I compile and run the following within Eclipse:
public class ConsoleEg {
    public static void main(String[] args) {
        System.out.println("System.console()=" + System.console());
}then I get the output:
{noformat}
    System.console()=null
{noformat}The [Console documentation|http://java.sun.com/javase/6/docs/api/java/io/Console.html] elaborates: "Whether a virtual machine has a console is dependent upon the underlying platform and also upon the manner in which the virtual machine is invoked. If the virtual machine is started from an interactive command line without redirecting the standard input and output streams then its console will exist and will typically be connected to the keyboard and display from which the virtual machine was launched. If the virtual machine is started automatically, for example by a background job scheduler, then it will typically not have a console.
If this virtual machine has a console then it is represented by a unique instance of this class which can be obtained by invoking the System.console() method. If no console device is available then an invocation of that method will return null."
Perhaps you should use the other methods for I/O: buffered reader and the print stream methods.

Similar Messages

  • Webutil with IE=native, can't get it up and running

    Hi,
    I'm impressed on the WebUtil functionality. Got it up and running smoothly using JInitiator. Great Stuff!
    My problem appears with a customer that wants me to deploy this functionality through native JVM of IE6.0.
    Did anyone of you manage to get Webutil up and running not using JInitiator but the native IE JVM??
    (When will webutilbase.htm be included in WebUtil?)
    Any help would be appreciated!!
    Kind Regards, Marc Vahsen
    =====================================================
    Details:
    I managed to:
    - create cab files for webutil.jar and jacob.jar, resulting in webutil.cab and jacob.cab
    When I try to invoke the first form that uses the webutil object group, I get errors:
    - FRM-92100 (connection to server lost)
    - Details: FRM-92040 Java class not found, javax.swing.JLabel
    Trying to analyze this with my restricted java knowledge, I see that this class is present in rt.jar, which is added to my (server) classpath in default.env.
    Should I make a cab file for this one also??
    Further analysis shows that the webutiljini.htm contains an extra "section" that calls oracle.forms.webutil.common.RegisterWebUtil.
    As the file 'webutilbase.htm' is missing in webutil_102.zip, I tried to create this htm file myself, with extra section:
    <!-- Registration applet definition (start) -->
    <APPLET CODEBASE="%codebase%"
    CODE="oracle.forms.webutil.common.RegisterWebUtil"
    WIDTH="0"
    HEIGHT="0">
    <PARAM NAME="cabbase" VALUE="webutil.cab,jacob.cab">
    <PARAM NAME="serverURL" VALUE="%serverURL%">
    <PARAM NAME="networkRetries" VALUE="%networkRetries%">
    </APPLET>
    <!-- Registration applet definition (end) -->
    This however does not work, and reduced my left options to 1: post a topic on OTN!

    Extra information:
    The code section that is unreadable in the topic description above (without the less than / greater than signs reads:
    APPLET CODEBASE="%codebase%"
    CODE="oracle.forms.webutil.common.RegisterWebUtil"
    WIDTH="0"
    HEIGHT="0"
    PARAM NAME="cabbase" VALUE="webutil.cab,jacob.cab"
    PARAM NAME="serverURL" VALUE="%serverURL%"
    PARAM NAME="networkRetries" VALUE="%networkRetries%"
    /APPLET

  • Firefox cannot be launched code: -0661. I do not have another web browser on my computer. computer is old 10.4.11 How can I get firefox up and running?

    When I turned on my computer today, Firefox had a circle with a line through it. Clicking on it I got an error message which reads "Firefox cannot be launched - 0661". I am running an old powerbook G4 OS 10.4.11. There is no other browser on my computer. I have a desktop with internet access. How can I get my laptop up and running?

    Disregard the above since Firefox 10 (or any version after Firefox 3.6) won't work on Mac OS 10.4.11. You will have to download Firefox 3.6 from http://www.mozilla.com/en-US/firefox/all-older.html and copy it to your old powerbook G4 OS 10.4.11
    Ref: [[Firefox will not start]] link: https://support.mozilla.org/en-US/kb/Firefox-not-start#w_firefox-will-not-start-on-os-x-10-4-or-earlier-or-with-a-powerpc-processor

  • I can not get any updates and therefor not use Java as it only run updates for Mac 10.7. and later? How do i get the updates to install and use Java?

    I can not get ny updates and therefore not use Java, as it only run updates for MAC 10.7. and later. How do i get the updates to install and use JAVA ?

    In Snow Leopard you update Java from Software Update (in the Apple menu). You can check your version by opening Terminal and typing
    java -version
    (don't get creative and type anything else)
    The latest version is 1.6.0_65.

  • I can run a slide show using apple tv and itunes but can't get the slides to run in a specific order

    I can run a slideshow (of pictures) using Apple TV and ITunes but can't get the pictures to run in the order I set them up with in my hard drive directory

    Welcome to the Apple Community.
    Websites and third party Apps need enabling before they will allow AirPlay of Video content. Some Website/App developers have not enabled their products, some simply haven't got around to it yet, others have stated that they won't be enabling AirPlay (likely as a result of licensing issues).
    I have created a User Tip to list Apps that have been tested with Video Airplay, if you have any Apps that you have tested please leave details in the comments at the bottom of the User Tip or email me if you don't have commenting privileges.

  • How to Get In & Out of Match, Get your Downloads and Run

    How to Get In & Out of Match, Get your Downloads and Run 
    So you have read the marketing hype, and are thinking what you really want is to pay for the service to upgrade your low quality bitrate files to a bit better 256KBPS rate easily, as don’t fancy rebuying/ reimporting or other method
    This guide should show you the fastest route to achieve you upgrades
    It assumes you’re working from your main music library, and know something about IT, and have <25k of music files
    Backup your music files
    If you know how to do this, its simple right – so once done then move to step 2, if not read below so you don’t blame me for a loss
    Transfer Hardware
    your choice the transfer hardware, suggest offline harddrive via USB3.0 (blue USB connector/eSata/ 1494b/1GB NIC/etcetera but your call
    If you use USB2.0/ 100MB NIC/1394a or other lower transfer method, accept the time hit
    Don’t use Time Backup/local disk backup software unless you have RAID 5 setup or better (and if wondering what that is, you almost certainly don’t then)
    Don’t use  internet backup service unless you live next door to the hosting company, with stunning internet connection to envy 99.9% of the human race, remember this is the fast method folks)
    Transfer Software
    I am assuming you know how to do a copy n paste/ robocoby/xcopy/drag n drop or whatever method turns you on via finder/explorer/cmd window ect
    Caveat #01: If not sure how to do above, then stop now as you are not IT literate ready for this
    Find your music files and back them up
    Now keep the computer running, preferably with nothing else running from this point for ease of use bar an active internet connection, and power saving switched off
    If you know where the files are great, backup the files, but some don’t so for them as below
    Caveat #02: if you don’t know how to find them your most likely on default settings, or sitting with a legacy from a past upgraded machine - below should help but you might want to stop now if you have never been curious about the location before
    Within iTunes , go to [Edit/Preferences/Advanced] and note down the location shown for Itunes Media Location
    In the same location of preferences, hit [Keep iTunes Media Folder organised] and let the application do its stuff.  You will end up with the location in 1ciii a ready to copy location which for simplicity of topic, copy the whole folder and its subfolders.  You may end up with some extra copies of music files (an iTunes safety mechanism, but it won’t show in the folder location, and we can ignore later on)
    Enable Match (after paying for the service)
    Run Match
    Accept that the Apple iTunes process is not perfect, may crash/stop/pause and reboots will be needed, and we can move on so to speak. Key here is you cannot do an unattended script or assume no end user interaction needed L
    Turn on iTunes Match, notice the new ITunes Match on the left hand sidebar, click it, then hit the Start button – if it works and you eventually get to STEP 3 perfect.
    If it fails before getting to STEP 3, reboot and restart
    If this still fails to get to STEP 3, then create a new iTunes database (browse forums on how to do), read your media files from the location in 1civ
    Stop MATCH  (the upload process only, not the service)
    Once STEP 3 starts, CLICK STOP - ASAP, as all this does it upload data, and you don’t want to do this, just get your upgraded files (remember the title of this entry your reading!)
    This also avoids future issues with Album art lost
    Delete Matched low bitrate files
    Create a NEW SMART playlist, with two criteria
    Show all files with bitrate is less then 256
    Show all files where iCloud status is MATCHED
    In the new playlist, click it and it shows the files we want to blow away. 
    Click Edit / Select All then
    Click ctrl in windows/apple  (cmd) logo in mac, and press delete button, ensuring you do NOT tick the delete from iCloud Option.  Now want a few mins for it do do its stuff.
    Download Upgraded BitRate Files
    In the same location as 5, reselect all, and right click, and select the option to download all, and off it goes
    On the lefthand sidebar in iTunes, click Downloads, and you will then see in the middle bottom screen an option for simultaneous downloads (select it)
    Your done Just let the app now do its stuff. I would ignore the message saying you can get on with other things, and use anther machine, preferably not using the same internet connection.
    Optional Steps:
    Click randomly from the Itunes/Matched/256KBPS listed files, and play them.  Not all the files, one every 30 or so, and just the start, then last few seconds to check not dead or corrupt files.
    Update your Step 1 backup with the new files, which is going to take up more space, guess at 40%.
    Kill your iTunes Match account (both the recurring automatic subscription, and  the account if not continuing to use the store part of iTunes)

    bump

  • How can I get my games to run smooth with apple tv. I'm getting jerky movement

    How can I get my games to run smooth with apple tv?

    Check your network for interference (www.istumbler.net, check router manual in regards to changing channels) and other activities possibly running in the background.

  • How can I get an mp4 video running on iPad Mini?

    How can I get an mp4 video running on iPad Mini, which is already in the iTunes File?

    Pad2, the new iPad Supported Video Formats & Movie Formats
    H.264 video up to 1080p, 30 frames per second, High Profile level 4.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats;
    MPEG-4 video up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats;
    Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format
    You can use a USB flash drive & the camera connection kit.
    Plug the USB flash drive into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov; DSCN0164.jpg).
    Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import. (You can not export using the camera connection kit.)
     Cheers, Tom

  • I have a macbook pro and I connected a new iphone to my computer. Somehow all my pictures in the iphoto app deleted. How can I get them back, and no I do not have my TimeMachine On. Please help!

    I have a macbook pro and I connected a new iphone to my computer. Somehow all my pictures in the iphoto app deleted. How can I get them back, and no I do not have my TimeMachine On. Please help!

    If you are running Lion then all drivers are distributed through Software Update. You do not need to install anything, other than to install the printer in System Preferences > Print & Scan. If you already added the printer while it was connected using USB, you might want to delete it and set it up again wirelessly to avoid confusion. Or, give them two distinct names e.g. "Photosmart D110 (USB)" and "Photosmart D110 (wireless)".
    All scanning functions are now performed using Preview, but you can also access the scanner through the same Print & Scan preference pane, or with Image Capture.
    This HP document may help explain how driver software is distributed now:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03079365&cc=us&dlc=en&lc=en &product=4144493&tmp_track_link=ot_search#N108

  • How can I get Flash Player and install it?

    I29/Aug/2010 17:37
    TO: Adobe Forum
    I am running Windows XP Home, and using Mozilla Firefox 3.6.8 as my browser.
    When I go to download and install the latest version of Flash Player, the ONLY option I get is to quit. In other words, I cannot download and install Flash Player. This even occurs at Adobe's own website.
    How can I get Flash Player and install it?
    Thank you in advance.
    Sincerely,
    Barry Karas

    First, you can manually download the installer here: http://get.adobe.com/flashplayer/otherversions/
    Second. On both my Mac (OS 10.6.4) and My PC (Vista Home Premium) I have had nothing but trouble with Firefox 3.6.8 and Flash player, Flash apps and Flash sites that require access to web cam or microphone or both.
    The last time Flash Player worked well with Firefox was 3.6.4, but I uninstalled 3.6.8 and went all the way back to 3.0 on both systems.
    Just a heads up. If you download the manual installer, and it still doesn't work, it ISN'T the Flash Player. It's Firefox. IE, Opera and Safari all work with it.
    Go to oldversion.com and get an older build of Firefox, uninstall 3.6.8, install the older one, go to Tools, and Options and turn off automatic checking for updates, so it doesn't try to take you back the the 3.6.8 "busted @$$ joint" that doesn't work worth poo.
    Maybe when they release 3.7, Firefox will have their act together with Adobe and Flash Player.

  • How can I get quicktime pro 7 running

    I bought quicktime pro 7 a couple of years ago and have a registration code.  At the time I used the program to make some time lapse movies.  I'd like to make a couple of time lapse movies again but quicktime pro 7 is no where to be found.  This probably ha something to do with updating the os between then and now.  The question is how can I get quicktime pro 7 running again?  The unlocking instructions I have for quicktime pro 7 that I received with the key do not correspond with what the system preferences now show.  Any assistance would be appreciated.  I am currently running OS X version 10.9.5 on an older iMac.

    Open the QuickTime 7 player(if it’s not installed, click here), choose Registration from the QuickTime Player 7 menu, and supply your key there.
    (115130)

  • How to get Adobe up and running?

    This download then go back and sign some agreement is stupid and it is not evident that there is anything to sign. I have clicked on agree several times and am still unable to get it to work. This is a Macbook Pro computer and I'm tired of not being able torun PDF's. Please help me get this up and running. there has to be a better way to go about this. Michael Allison

    Not sure what you mean by "sign agreement"; do you mean accept the license agreement?  To do that you must open Reader by itself and accept the EULA, before you can use it online.
    If I misunderstood, please clarify.

  • I have a I-mac that is not able to upgrade the os past 10.7.5, when I go to upgrade Pages it says i have to be running os 10.10, how can I get Pages that will run with os 10.7.5.

    I have a I-mac that is not able to upgrade the os past 10.7.5, when I go to upgrade Pages it says i have to be running os 10.10, how can I get Pages that will run with os 10.7.5.

    Click here and follow the instructions. If they’re not applicable, buy an iWork 09 DVD from a source such as Amazon or eBay.
    (116937)

  • Updated software on Macbook Air and bootcamp partition disappeared.  Windows boot option no longer appears.  Can I get it back and the data?

    Updated software on Macbook Air and bootcamp partition disappeared.  Windows boot option no longer appears.  Can I get it back and the data?

    Amy, is there a chance they could both be Syncing to another device that has the data erased?
    What are the sizes & modification dates on the files you found?
    Could be many things, we should start with this to be safe, though 2 different ones would seem unlikely to be this problem...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at the top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.

  • Can not get JSP examples to run

    I am able to use the example servlets, but I can not get the JSP examples to run. I get the error listed at the end of this message.
    I am using jdk1.3.x and TOMCAT Version 3.2.3
    Here is my classpath
    .;C:\jdk1.3\jre\lib\rt.jar;c:\jdk1.3\lib\tools.jar;C:\jakarta-tomcat\webapps\privilegesparadox;C:\jdk1.3jre\lib\ext\XML4J.JAR;C:\jdk1.3\jre\lib\ext\mm.mysql-2.0.4-bin.jar;C:\jdk1.3jre\lib\ext\mssqlserver.jar;C:\jdk1.3\jre\lib\ext\mail.jar;C:\jdk1.3jre\lib\ext\activation.jar;C:\Netscape\Servers\java\ldapjdk.jar
    I am running this on win2000. I have done several years of servlet work and now am needing to do JSP stuff. I can not get the examples to run... so any of my test stuff does not work either.
    Error: 500
    Location: /examples/jsp/dates/date.jsp
    Internal Servlet Error:
    javax.servlet.ServletException: sun/tools/javac/Main
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:508)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:484)
    Root cause:
    java.lang.NoClassDefFoundError: sun/tools/javac/Main
         at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:136)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
         at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
         at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:258)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:268)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:484)

    I don't get it... I have been using jdk 1.3.x for sometime... a year now. All seems fine with servlets and java applications I have created. What could be not there if all of this works?
    If reinstall the jdk over top of where is is now, would that be of any help? I will copy my /ext jar files to a temp area first so I can keep my jar files.
    Dean-O

Maybe you are looking for

  • InfoSet modelling - Link Maintenance between tables

    Hi I want to create an infoset between 2 DSO objects, we are using BI 7, and I am following the help from http://help.sap.com/saphelp_nw70/helpdata/EN/b1/713c3b35703079e10000000a114084/frameset.htm I have a couple of very simple questions This is wha

  • Wireless Printing for my Macbook???

    I recently bought a HP Photosmart C4580 Wireless Printer. It's hooked up to my I- MAC and working fine. Does anyone know how I can enable my macbook to send documents so I can print to it? Any help is greatly appreciated!!!!! Thanks!!!

  • SPA525G MonitorView with a PVC2300 Camera

    Hi, we have a customer who currently has a SPA525G phone installed and uses the MonitorView feature to view video on the PVC2300.  The problem is, they find the user interface too cumbersome, needing to hit multiple buttons to get to the correct scre

  • Sorting Service contract Quaotations search result table by new field

    Dear Experts,                        I have enhanced the Service contact quotations search, by adding 'country' field in both search screen and result screeen.  I added the 'country' field as model attribute by taking reference of  'BuilHeaderSearch'

  • Trouble reinstalling Exchange Mail account

    I accidentally deleted my exchange account on my Mail. It was working perfectly before, and is still working on my other MacBook. When I try to add the account, it gives me this message: The Exchange server "exchange2.hungersolutionsny.local" is not