Can't run java apps with System.out.println on any builder.

Hello,
I'm currently using Vista RC2, which is the immediate problem.
Classes with System.out.println won't launch the console window. As I'm a student and practicing on these steps, I do have quite a problem on my hands. I click on run, build succesfull, nothing happens.
I have tried Netbeans and Jcreator, and gave up on trying different builds, as I reckon I'll have to find some other way to counter this; any way to get println messages working in vista?

It is run as a desktop app, and other runs with commands such as JOptionPane do function, only the println windows don't appear at all. So I think JRE is installed and working.
I did notice there was one command for input where I'd be able to enter it at the bottom of Netbeans.
Like just now I clicked build and run for the following code
import java.util.*;
public class FirstProgram
    public static void main(String[] args)
        System.out.println("Hello out there.");
        System.out.println("I will add two numbers for you.");
        System.out.println("Enter two whole numbers on a line:");
        int n1, n2;
        Scanner keyboard = new Scanner(System.in);
        n1=keyboard.nextInt();
        n2=keyboard.nextInt();
        System.out.println("The sum of those two numbers is");
        System.out.println(n1+n2)
}Resulting in a brief flash of "input" in the output window (which is below the coding window) and it dissapears. But this also occurs when I don't include system scanner code.
Using commands in cmd
java -jar "C:\Users\Alegis\Netb\MyApp\dist\MyApp.jar"
Does not yield desired results either. Nothing happens.

Similar Messages

  • Snow Leopard 10.6.2 can't run 'X11.app' (with system log)

    Hello everyone, English is not my mother tongue so may not be exactly correct, sorry about that.
    Background:
    I have a MacBook White (13-inch, Mid 2009) that isn't unibody, and was running Leopard 10.5.
    I am the only one that will use the Mac and my user account is as the 'admin'.
    When I was using 10.5, I could open the 'X11.app'.
    But few days ago, I did a clean installation of 10.6.2 Snow Leopard from the USD$29 disc.
    After that I installed the iLife '09 (the gray disc bundled with the MacBook),
    and I cloned the drive to my ext. FireWire HD immediately after the installation of SL and iLife'09 by using the CCC (Carbon Copy Cloner).
    After that, of course, I was going to install the apps I need, and update the software.
    _But the problem appears:_
    When I try to open the 'X11.app', the X11 icon begins jumping on the Dock, but nothing happens.
    Jumping and jumping... finally, it doesn't jump any more, with just the X11 icon on the dock.
    What's more, there is no white dot under the icon, which means the app isn't running at the moment.
    I right-clicked the icon, it shows me 'application not responding'.
    So, I open the *Activity Monitor*, and I can see there are two apps related to X11 are running:
    (1) X11
    (2) X11.bin
    Please see below for the system log (around 1min. log, starting with the time when I open the X11)
    ==========
    Feb 20 15:56:30 (my user name)-(my user name)-MacBook 0x0-0x33033.org.x.X1128300: X11.app: main(): argc=2
    Feb 20 15:56:30 (my user name)-(my user name)-MacBook 0x0-0x33033.org.x.X1128300: argv[0] = /Applications/Utilities/X11.app/Contents/MacOS/X11.bin
    Feb 20 15:56:30 (my user name)-(my user name)-MacBook 0x0-0x33033.org.x.X1128300: argv[1] = -psn0208947
    Feb 20 15:56:30 (my user name)-(my user name)-MacBook 0x0-0x33033.org.x.X1128300: Waiting for startup parameters via Mach IPC.
    Feb 20 15:56:33 (my user name)-(my user name)-MacBook org.x.startx28308: font_cache: Scanning user font directories to generate X11 font caches
    Feb 20 15:56:33 (my user name)-(my user name)-MacBook org.x.startx28308: font_cache: Updating FC cache
    Feb 20 15:56:33 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Scanning system font directories to generate X11 font caches
    Feb 20 15:56:33 (my user name)-(my user name)-MacBook defaults28334: \nThe domain/default pair of (org.x.X11, dpi) does not exist
    Feb 20 15:56:33 (my user name)-(my user name)-MacBook org.x.startx28308: xauth: creating new authority file /Volumes/(my user name)'s Home/Users/(my user name)/.serverauth.28308
    Feb 20 15:56:33 (my user name)-(my user name)-MacBook org.x.startx28308: /usr/X11/bin/startx: eval: line 288: unexpected EOF while looking for matching `''
    Feb 20 15:56:33 (my user name)-(my user name)-MacBook org.x.startx28308: /usr/X11/bin/startx: eval: line 289: syntax error: unexpected end of file
    Feb 20 15:56:33 (my user name)-(my user name)-MacBook com.apple.launchd.peruser.501135 (org.x.startx): Throttling respawn: Will start in 10 seconds
    Feb 20 15:56:34 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Updating FC cache
    Feb 20 15:56:36 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Done
    Feb 20 15:56:44 (my user name)-(my user name)-MacBook org.x.startx28441: font_cache: Scanning user font directories to generate X11 font caches
    Feb 20 15:56:44 (my user name)-(my user name)-MacBook org.x.startx28441: font_cache: Updating FC cache
    Feb 20 15:56:44 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Scanning system font directories to generate X11 font caches
    Feb 20 15:56:44 (my user name)-(my user name)-MacBook defaults28467: \nThe domain/default pair of (org.x.X11, dpi) does not exist
    Feb 20 15:56:44 (my user name)-(my user name)-MacBook org.x.startx28441: xauth: creating new authority file /Volumes/(my user name)'s Home/Users/(my user name)/.serverauth.28441
    Feb 20 15:56:44 (my user name)-(my user name)-MacBook org.x.startx28441: /usr/X11/bin/startx: eval: line 288: unexpected EOF while looking for matching `''
    Feb 20 15:56:44 (my user name)-(my user name)-MacBook org.x.startx28441: /usr/X11/bin/startx: eval: line 289: syntax error: unexpected end of file
    Feb 20 15:56:44 (my user name)-(my user name)-MacBook com.apple.launchd.peruser.501135 (org.x.startx): Throttling respawn: Will start in 10 seconds
    Feb 20 15:56:44 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Updating FC cache
    Feb 20 15:56:46 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Done
    Feb 20 15:56:54 (my user name)-(my user name)-MacBook org.x.startx28574: font_cache: Scanning user font directories to generate X11 font caches
    Feb 20 15:56:54 (my user name)-(my user name)-MacBook org.x.startx28574: font_cache: Updating FC cache
    Feb 20 15:56:54 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Scanning system font directories to generate X11 font caches
    Feb 20 15:56:54 (my user name)-(my user name)-MacBook defaults28602: \nThe domain/default pair of (org.x.X11, dpi) does not exist
    Feb 20 15:56:54 (my user name)-(my user name)-MacBook org.x.startx28574: xauth: creating new authority file /Volumes/(my user name)'s Home/Users/(my user name)/.serverauth.28574
    Feb 20 15:56:54 (my user name)-(my user name)-MacBook org.x.startx28574: /usr/X11/bin/startx: eval: line 288: unexpected EOF while looking for matching `''
    Feb 20 15:56:54 (my user name)-(my user name)-MacBook org.x.startx28574: /usr/X11/bin/startx: eval: line 289: syntax error: unexpected end of file
    Feb 20 15:56:54 (my user name)-(my user name)-MacBook com.apple.launchd.peruser.501135 (org.x.startx): Throttling respawn: Will start in 10 seconds
    Feb 20 15:56:54 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Updating FC cache
    Feb 20 15:56:56 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Done
    Feb 20 15:57:04 (my user name)-(my user name)-MacBook org.x.startx28708: font_cache: Scanning user font directories to generate X11 font caches
    Feb 20 15:57:04 (my user name)-(my user name)-MacBook org.x.startx28708: font_cache: Updating FC cache
    Feb 20 15:57:04 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Scanning system font directories to generate X11 font caches
    Feb 20 15:57:04 (my user name)-(my user name)-MacBook defaults28734: \nThe domain/default pair of (org.x.X11, dpi) does not exist
    Feb 20 15:57:04 (my user name)-(my user name)-MacBook org.x.startx28708: xauth: creating new authority file /Volumes/(my user name)'s Home/Users/(my user name)/.serverauth.28708
    Feb 20 15:57:04 (my user name)-(my user name)-MacBook org.x.startx28708: /usr/X11/bin/startx: eval: line 288: unexpected EOF while looking for matching `''
    Feb 20 15:57:04 (my user name)-(my user name)-MacBook org.x.startx28708: /usr/X11/bin/startx: eval: line 289: syntax error: unexpected end of file
    Feb 20 15:57:04 (my user name)-(my user name)-MacBook com.apple.launchd.peruser.501135 (org.x.startx): Throttling respawn: Will start in 10 seconds
    Feb 20 15:57:04 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Updating FC cache
    Feb 20 15:57:06 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Done
    Feb 20 15:57:14 (my user name)-(my user name)-MacBook org.x.startx28841: font_cache: Scanning user font directories to generate X11 font caches
    Feb 20 15:57:14 (my user name)-(my user name)-MacBook org.x.startx28841: font_cache: Updating FC cache
    Feb 20 15:57:14 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Scanning system font directories to generate X11 font caches
    Feb 20 15:57:14 (my user name)-(my user name)-MacBook defaults28869: \nThe domain/default pair of (org.x.X11, dpi) does not exist
    Feb 20 15:57:14 (my user name)-(my user name)-MacBook org.x.startx28841: xauth: creating new authority file /Volumes/(my user name)'s Home/Users/(my user name)/.serverauth.28841
    Feb 20 15:57:14 (my user name)-(my user name)-MacBook org.x.startx28841: /usr/X11/bin/startx: eval: line 288: unexpected EOF while looking for matching `''
    Feb 20 15:57:14 (my user name)-(my user name)-MacBook org.x.startx28841: /usr/X11/bin/startx: eval: line 289: syntax error: unexpected end of file
    Feb 20 15:57:14 (my user name)-(my user name)-MacBook com.apple.launchd.peruser.501135 (org.x.startx): Throttling respawn: Will start in 10 seconds
    Feb 20 15:57:14 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Updating FC cache
    Feb 20 15:57:16 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Done
    Feb 20 15:57:24 (my user name)-(my user name)-MacBook org.x.startx28974: font_cache: Scanning user font directories to generate X11 font caches
    Feb 20 15:57:24 (my user name)-(my user name)-MacBook org.x.startx28974: font_cache: Updating FC cache
    Feb 20 15:57:24 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Scanning system font directories to generate X11 font caches
    Feb 20 15:57:24 (my user name)-(my user name)-MacBook defaults29000: \nThe domain/default pair of (org.x.X11, dpi) does not exist
    Feb 20 15:57:24 (my user name)-(my user name)-MacBook org.x.startx28974: xauth: creating new authority file /Volumes/(my user name)'s Home/Users/(my user name)/.serverauth.28974
    Feb 20 15:57:24 (my user name)-(my user name)-MacBook org.x.startx28974: /usr/X11/bin/startx: eval: line 288: unexpected EOF while looking for matching `''
    Feb 20 15:57:24 (my user name)-(my user name)-MacBook org.x.startx28974: /usr/X11/bin/startx: eval: line 289: syntax error: unexpected end of file
    Feb 20 15:57:24 (my user name)-(my user name)-MacBook com.apple.launchd.peruser.501135 (org.x.startx): Throttling respawn: Will start in 10 seconds
    Feb 20 15:57:25 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Updating FC cache
    Feb 20 15:57:27 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Done
    ==========
    It seems that the processes are repeating themselves,
    so I decide to end them in the *Activity Monitor*.
    For 'X11', I have to force quit.
    For 'X11.bin', 'quit' is enough.
    But after that, it seems that the processes are stilling running:
    ==========
    Feb 20 16:03:11 (my user name)-(my user name)-MacBook org.x.startx33510: xauth: creating new authority file /Volumes/(my user name)'s Home/Users/(my user name)/.serverauth.33510
    Feb 20 16:03:11 (my user name)-(my user name)-MacBook org.x.startx33510: /usr/X11/bin/startx: eval: line 288: unexpected EOF while looking for matching `''
    Feb 20 16:03:11 (my user name)-(my user name)-MacBook org.x.startx33510: /usr/X11/bin/startx: eval: line 289: syntax error: unexpected end of file
    Feb 20 16:03:11 (my user name)-(my user name)-MacBook com.apple.launchd.peruser.501135 (org.x.startx): Throttling respawn: Will start in 10 seconds
    Feb 20 16:03:11 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Updating FC cache
    Feb 20 16:03:13 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Done
    Feb 20 16:03:21 (my user name)-(my user name)-MacBook org.x.startx33643: font_cache: Scanning user font directories to generate X11 font caches
    Feb 20 16:03:21 (my user name)-(my user name)-MacBook org.x.startx33643: font_cache: Updating FC cache
    Feb 20 16:03:21 (my user name)-(my user name)-MacBook org.x.privileged_startx206: font_cache: Scanning system font directories to generate X11 font caches
    Feb 20 16:03:21 (my user name)-(my user name)-MacBook defaults33669: \nThe domain/default pair of (org.x.X11, dpi) does not exist
    Feb 20 16:03:21 (my user name)-(my user name)-MacBook org.x.startx33643: xauth: creating new authority file /Volumes/(my user name)'s Home/Users/(my user name)/.serverauth.33643
    ==========
    As I've said, I have a clone of 10.6.2 on my ext. FireWire HD.
    So I've tried to boot the MacBook with the key 'option' pressed in order to boot from the clone.
    What surprises me is that I can open the X11 without any problem.
    And I've tried to open a new user account to test.
    Even if the account isn't 'admin', the X11 can be opened too.
    What this phenomenon tells me is that maybe there is an app(s) that I installed will make the X11 not open.
    I've Googled the problem and tried the following methods:
    (1) Reinstall the X11 from the Snow Leopard disc.
    (2) Log in as the 'root' user, go to *System Preferences* to create a temporary account (e.g. named 'test') so that I can delete my current account (e.g. named 'User') (I copied the UUID and pasted it into TextEdit, saving it on my different partition of ext. FireWire HD.). Then I open a new account with the same username (named 'User') and paste the UUID I previously saved to the newly created account (named 'User'), and then redirect the home folder path to the original home folder (the account named 'User' that I deleted).
    (3) Create an account for testing (e.g. named 'test'), set it as admin. Then log in as the 'root' user, to use 'ditto' command in Terminal to copy my home folder to the account named 'test'. After that, I make the account for testing (account name 'test') have the permission to read and write the files by pressing 'command + I' the home folder, and then set the user 'test' having the permission to read and write and apply this to all the enclosed folder.
    NONE of the above has worked.
    So what can I do in order to make my X11.app work again?
    Thanks in advance!!

    etresoft wrote:
    But you have it running in the other account. With X11 problems, this is as easy as it gets.
    I hope this problem can be solved soon...
    Unfortunately, I'm pretty sure you are going to have to use the Terminal.
    I see, thanks for the info.! (I am new to the Mac since 2009 )
    The only one that would cause any problem by being removed is ".Trash". You don't have any of the other files that Bob is talking about. It would be annoying for any heavy Terminal user to lose those dot files, but perfectly safe.
    There is no need to even attempt to backup anything in /tmp.
    Thanks for the info.!
    Try this. In System Preferences, select Sharing and enable "Remote Login". Login to that Standard user who can run X11 with no problem. Then, just as a test, run "ssh <mainuser>@localhost". Verify that you are in the home directory of the user with the X11 problems. Don't do anything yet. Just type 'exit' to logout.
    Reboot your machine. Login as the Standard User. Run "ssh <mainuser>@localhost" again. This time, run the "rm .<somefile>" on all those dot files (except for .Trash and maybe .CFUserEncoding). This time they should all stay deleted. Follow Bob's advice too and do "rm Library/Preferences/org.x.X11.plist". Type "cd /tmp" and delete everything you can find in there. You can't do any damage there. Type "exit" to quit the ssh session.
    Now logout of the standard user and log back in to your primary user and try it again.
    I am now at the standard account called 'test' and browse this web page using Safari through Wi-Fi.
    4 things:
    .bash_history
    .DS_Store
    .fontconfig
    .Xauthority
    ==========
    With the '.fontconfig', I can't delete it from the Terminal:
    +Michael-Leungs-MacBook:~ Michael$ rm .fontconfig+
    _+rm: .fontconfig: is a directory+_
    (At this moment, I Googled the 'rm' command and found these web pages:
    http://ss64.com/osx/
    http://newsourcemedia.com/blog/basic-terminal-commands/
    That's why I try the 'rmdir' and 'sudo rm'.
    But NONE of these command helps)
    +Michael-Leungs-MacBook:~ Michael$ rmdir .fontconfig+
    _+rmdir: .fontconfig: Directory not empty+_
    +Michael-Leungs-MacBook:~ Michael$ sudo rm .fontconfig+
    +WARNING: Improper use of the sudo command could lead to data loss+
    +or the deletion of important system files. Please double-check your+
    +typing when using sudo. Type "man sudo" for more information.+
    +To proceed, enter your password, or type Ctrl-C to abort.+
    Password:
    +Sorry, try again.+
    Password:
    _+rm: .fontconfig: is a directory+_
    +Michael-Leungs-MacBook:~ Michael$ sudo rm .fontconfig+
    _+rm: .fontconfig: is a directory+_
    =========
    For the '/tmp':
    +Michael-Leungs-MacBook:~ Michael$ cd /tmp+
    +Michael-Leungs-MacBook:tmp Michael$ cd /+
    +Michael-Leungs-MacBook:/ Michael$ sudo rm -rf /tmp+
    Password:
    +Michael-Leungs-MacBook:/ Michael$ +
    So, for the steps you provided, I can follow all the steps except the one '.fontconfig'
    Hope the information I provided above can help you to help me!
    Thank you etresoft!

  • Can't Run Java Apps

    I use Java run live stock market feeds which have always worked perfectly on 10.4.10. Just bought a new MacBook running 10.5.1 - I managed to get it working a couple of times but now will not work at all. I tried everything I can think of including fsck which found no faults and I even copied over my Java files from my PowerBook to the MacBook. So it seems that 10.5.1 does not work with Java J2SE 5.0. The application I run says I need Java 1.5 but I cannot seem to locate this anywhere to download and the previous versions in the J2SE 5.0 are 1.3.1 and 1.4.2 plugins. The site where I am logging into the live fees from does have link to a 1.5 plugin which I have downloaded several times but makes no difference, when I open the file it is all weird looking text which may be perfectly normal, not sure e.g.
    MZê

    It is run as a desktop app, and other runs with commands such as JOptionPane do function, only the println windows don't appear at all. So I think JRE is installed and working.
    I did notice there was one command for input where I'd be able to enter it at the bottom of Netbeans.
    Like just now I clicked build and run for the following code
    import java.util.*;
    public class FirstProgram
        public static void main(String[] args)
            System.out.println("Hello out there.");
            System.out.println("I will add two numbers for you.");
            System.out.println("Enter two whole numbers on a line:");
            int n1, n2;
            Scanner keyboard = new Scanner(System.in);
            n1=keyboard.nextInt();
            n2=keyboard.nextInt();
            System.out.println("The sum of those two numbers is");
            System.out.println(n1+n2)
    }Resulting in a brief flash of "input" in the output window (which is below the coding window) and it dissapears. But this also occurs when I don't include system scanner code.
    Using commands in cmd
    java -jar "C:\Users\Alegis\Netb\MyApp\dist\MyApp.jar"
    Does not yield desired results either. Nothing happens.

  • [solved]can't run java apps from command line

    Every Java program that i've tried to run from command line gives me a error message like this:
    augusto java% java Test
    Exception in thread "main" java.lang.NoClassDefFoundError: Test
    Caused by: java.lang.ClassNotFoundException: Test
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    Could not find the main class: Test. Program will exit.
    `java Test.class` doesn't work too.
    but, the exact same code work from eclipse, am I missing something?
    Some info:
    % ls Test*
    Test.class Test.java Test.java~
    % cat Test.java
    public class Test{
    public static void main(String[] args){
    System.out.println("doesn't work");
    % echo $PATH
    /home/augusto/.bin:/home/augusto/.bin:/home/augusto/GNUstep/Tools:/opt/GNUstep/Local/Tools:/opt/GNUstep/System/Tools:/bin:/usr/bin:/sbin:/usr/sbin:/opt/java/bin:/opt/java/jre/bin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core:/opt/qt/bin
    Last edited by hack.augusto (2009-10-27 00:57:53)

    also make sure that you current directory is in your classpath.
    eg
    export CLASSPATH=".:$CLASSPATH"
    java Test
    your issue is more likely to be classpath related, as java doesn't read the path variable, and the java executable is found
    Last edited by bruce (2009-10-27 01:02:51)

  • Strange behavior with System.out.println

    I was working with the following code:
    1. public class DemoChar {
    2. public static void main(String args[]) {
    3.
    4. char buf[] = new char[50];
    5. buf[0] = 'a';
    6. buf[1] = 'b';
    7. buf[2] = 'c';
    8. buf[3] = 'd';
    9. buf[4] = 'e';
    10. System.out.println( buf);
    11. }
    12. }
    if you print "buf", it really works; however if you change line 10 by :
    System.out.println("--->" + buf );
    The method "println()" doesn't write "--->abcde". The functionality doesn't the same. It will appear "----> [C@3e25a5"
    Could you help me?
    I don't understand that behavior. I am using "java version 1.6.0_07"

    buf's an array and thus is an object. object's don't inherently know how to represent themselves as Strings, so you have to do other things to make sure that they print out ok. To get a char array to print well, you could use the String method valueOf(...):
    public class DemoChar
      public static void main(String args[])
        char buf[] = {'a', 'b', 'c', 'd', 'e'};
        System.out.println(buf);  // this seems to call implicitly String.valueOf(buf)
        System.out.println("--->" + buf);  // this however seems to call buf.toString() with different results
        System.out.println("--->" + String.valueOf(buf));
    }Also, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, you can will need to paste already formatted code into the forum, highlight this code, and then press the "code" button at the top of the forum Message editor prior to posting the message. You may want to click on the Preview tab to make sure that your code is formatted correctly. Another way is to place the tag &#91;code] at the top of your block of code and the tag &#91;/code] at the bottom, like so:
    &#91;code]
      // your code block goes here.
      // note the differences between the tag at the top vs the bottom.
    &#91;/code]or
    {&#99;ode}
      // your code block goes here.
      // note here that the tags are the same.
    {&#99;ode}Edited by: Encephalopathic on Aug 21, 2008 9:40 AM

  • Problems with System.out.println()

    I tried writing a simple 'Hello world'-program:
    public class Test{
         public static void main(String[] args){
              System.out.println("Hello World!");
         }//main()
    }//Test
    But the text wouldn't appear in the DOS-window. The only text that showed up was the standard 'Press any key to close the window'. The program compiled without any problems, but didn't work when I tried to run it.
    Does anyone have any idea what's wrong?

    Are u sure , the main() class part is donecorrectly.
    Becuse program will compile but not run without a
    main() class.what do you mean by main() class???First of all main() is a method, not a class. The main() method the JRE recognizes and runs is the:
    public static void main(String[] params)
    If you don�t have exaclty those modifiers and receive an array of Strings parameter it will send you an runtime exception.
    Your code compiles and runs fine, the problem isn�t really System.out.print() it is something with your configuration.
    I have to rename the class to TestF. Here is the running:
    C:\cJava>javac TestF.java
    C:\cJava>java TestF
    Hello World!

  • Can't run my app with older version of jre anymore.  Help!

    Java Web Start is supposed to allow applications to use older versions of Java JRE. My applet uses 1.6.0_31 because it doesn't work with 1.7. (Backward compatibility? Don't ask.)
    When I first set it up a couple of weeks ago, it worked. Now, with JRE 1.7 officially released it does not. When I try to run it, I get the following message:
    "This application would like to use an older version of Java (1.6.0_31) that is not installed on your system. We recommend running the application with the latest version o java on your computer. Then there are two buttons.
    One button says "Run with latest version". The other button says "Cancel". When I click on "Cancel" the application fails with the following
    basic: LaunchDesc location: http://relativitysimulation.com/Applet.jnlp
    network: Created version ID: 1.6.0.31
    network: Created version ID: 1.7.0.03
    network: Created version ID: 1.7.0.03
    network: Created version ID: 1.7.0.03
    network: Created version ID: 1.7
    network: Created version ID: 1.6.0.31
    network: Created version ID: 1.6
    network: Created version ID: 1.7.0.03
    network: Created version ID: 1.7
    network: Created version ID: 1.7.0.03
    network: Created version ID: 1.7
    network: Created version ID: 1.6.0.31
    network: Created version ID: 1.7.0.03
    network: Created version ID: 1.7.0.03
    network: Created version ID: 1.7.0.03
    network: Created version ID: 1.7
    java.util.MissingResourceException: Can't find resource for bundle sun.applet.resources.MsgAppletViewer, key appletpanel.ExitException[ 0]
         at java.util.ResourceBundle.getObject(ResourceBundle.java:393)
         at java.util.ResourceBundle.getString(ResourceBundle.java:353)
         at sun.plugin2.applet.Applet2MessageHandler.getMessage(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.logAppletStatus(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:722)
    basic: ExitException[ 0]
    ExitException[ 0]
         at com.sun.javaws.ui.SecureStaticVersioning.showCannotDownloadDialog(Unknown Source)
         at com.sun.javaws.ui.SecureStaticVersioning.canAutoDownload(Unknown Source)
         at sun.plugin2.applet.JNLP2Manager$JnlpLaunchState.doJvmSelection(Unknown Source)
         at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
         at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:722)
    security: Accessing keys and certificate in Mozilla user profile: null
    security: Reset deny session certificate store
    Looks to me like Cancel does not mean "Run Older Version". While I am debugging why I can't use the latest version of jre, can someone please tell me how to use the older version?
    Edited by: 932841 on May 8, 2012 8:54 AM - corrected typo

    I'm the developer. And thank you for your prompt response. I have been given a work around so that the applet can use version 1.7. But that still doesn't explain what I am doing that makes Java fail to use the older version.
    I put this code in my jnlp file on March 27th when I realized that my app didn't work with version 1.7. I tested it at that time and it worked. In the process I installed and uninstalled java 1.6.0_31 ( and 1.7) several times. Maybe something important got corrupted then.
    <resources>
         <j2se version="1.6.0_31" href="http://java.sun.com/products/autodl/j2se"/>
    Added this -----
    Oh, if someone else wants to try this app on their machine, feel free. It is at
    http://www.relativitysimulation.com/Applet.html
    Edited by: 932841 on May 8, 2012 11:13 AM

  • Can't run java program with GUI

    My computer can run java program properly.
    However, for those program with GUI (using swing),
    my computer is unable to display the GUI.
    What's wrong with it? Is there any PATH I need to set before running GUI program?
    Thanks
    icedgold

    Cut, copy, paste then compile and run this;-import java.awt.*;
    import javax.swing.*;
    public class MyJFrame extends JFrame {
      public MyJFrame() {
          super("My first JFrame");
          Container c  = getContentPane();
          JPanel panel = new JPanel();
          panel.setBackground(Color.white);//  (new Color(255, 255, 255));
          JLabel jl = new JLabel("Yes it works");
          panel.add(jl);     
          c.add(panel);
      public static void main(String[] args) {
        MyJFrame frame = new MyJFrame();
        frame.setSize(180,120);
        frame.setLocation(200, 300);
        frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
        frame.setVisible(true);
    }

  • How can i run java application at system startup just liks as services

    How we can run java application at the time of system
    starts up just like as services.

    Hi,
    At first you have to create an exe of the class file.
    for that go to the site www.duckware.com/java2exe.html
    Click on the j2exe23c.exe(75k) download it and install in ur system. convert the class file to windows exe.
    The put the exe in the startup folder in windows.
    If ur not able to find that folder search for it and put that exe in that folder.

  • Snow Leopard 10.6.2 takes a long time to run 'X11.app' (with system log)

    Hello everyone, English is not my mother tongue so may not be exactly correct, sorry about that.
    Background:
    I have a MacBook White (13-inch, Mid 2009) that isn't unibody, and was running Leopard 10.5.
    I did a clean installation and now Snow Leopard 10.6.2, with iLife, iWork, and many many apps.
    I am the only one who will use the Mac and my user account is as the 'admin'.
    I previously had a problem concerning X11 too:
    http://discussions.apple.com/thread.jspa?threadID=2343732
    *What I've done:*
    (1) rename my HD to 'Michaels_Home' under 'Get Info' from Finder (I can't rename in Disk Utility though)
    (2) press return (enter)
    (3) change my home folder path to the '/Volumes/Michaels_Home/Users/Michael' (http://eshop.macsales.com/Reviews/Framework.cfm?page=Tips/relocate3/relocate3.ht ml)
    (4) restart
    (5) log in and open X11
    (6) problem solved!!
    ==========
    *BUT NOW* I have a problem after:
    (1) log in as the root user, and use command +ditto -V xyz xyz+ to copy my home folder from '/Volumes/Michaels_Home/Users/Michael' to '/Users>Michael'
    (2) change my home folder path to the '/Users/Michael' (http://eshop.macsales.com/Reviews/Framework.cfm?page=Tips/relocate3/relocate3.ht ml)
    (3) use the Mac OS X Snow Leopard USD$29 disc to boot my Mac up
    (4) delete the 'Michaels_Home' partition (I had 3 partitions: (1) Macintosh HD (2) Michaels_Home (3) Windows XP Professional)
    (5) resize the 'Macintosh HD' partition
    (6) boot from Macintosh HD
    (7) find that there's a problem about X11
    _The problem:_
    it takes a *long time* for X11 to start.
    When I try to open the 'X11.app', the X11 icon begins jumping on the Dock, but nothing happens.
    Jumping and jumping... finally, it doesn't jump any more, with just the X11 icon on the dock.
    What's more, there is no white dot under the icon, which means the app isn't running at the moment.
    I right-clicked the icon, it shows me 'application not responding'.
    So, I open the *Activity Monitor*, and I can see there are 3 apps related to X11 are running:
    (1) X11
    (2) X11.bin
    (3) xauth
    *At the moment now, if you would wait for about 1.5 min., X11 will open.*
    Please see below for the system log (from 'FREEZING' to 'WORKING')
    ==========
    Mar 1 00:42:10 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: main(): argc=2
    Mar 1 00:42:10 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[0] = /Applications/Utilities/X11.app/Contents/MacOS/X11.bin
    Mar 1 00:42:10 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[1] = -psn0139298
    Mar 1 00:42:10 n219073058253 [0x0-0x22022].org.x.X11[327]: Waiting for startup parameters via Mach IPC.
    Mar 1 00:42:10 n219073058253 org.x.startx[335]: font_cache: Scanning user font directories to generate X11 font caches
    Mar 1 00:42:10 n219073058253 org.x.startx[335]: font_cache: Updating FC cache
    Mar 1 00:42:10 n219073058253 org.x.privileged_startx[344]: font_cache: Scanning system font directories to generate X11 font caches
    Mar 1 00:42:10 n219073058253 defaults[370]: \nThe domain/default pair of (org.x.X11, dpi) does not exist
    Mar 1 00:42:12 n219073058253 org.x.privileged_startx[344]: font_cache: Updating FC cache
    Mar 1 00:42:13 n219073058253 org.x.startx[335]: font_cache: Done
    Mar 1 00:42:14 n219073058253 org.x.privileged_startx[344]: font_cache: Done
    Mar 1 00:42:31 n219073058253 org.x.startx[335]: xauth: timeout in locking authority file /Users/Michael/.serverauth.335
    Mar 1 00:42:51 n219073058253 org.x.startx[335]: xauth: timeout in locking authority file /Users/Michael/.Xauthority
    Mar 1 00:43:31: --- last message repeated 1 time ---
    Mar 1 00:43:31 n219073058253 org.x.startx[335]: xauth: timeout in locking authority file /Users/Michael/.Xauthority
    Mar 1 00:43:51: --- last message repeated 1 time ---
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: Listening on socket for fd handoff: (4) /var/tmp/tmp.0.9OYerf
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: Thread created for handoff. Returning success to tell caller to connect and push the fd.
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: Received new $DISPLAY fd: 6 ... sleeping to allow xinitrc to catchup.
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: dostart_x11server(): argc=6
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[0] = /usr/X11/bin/X
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[1] =
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[2] = -nolisten
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[3] = tcp
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[4] = -auth
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[5] = /Users/Michael/.serverauth.335
    Mar 1 00:43:51 n219073058253 org.x.startx[335]: Xquartz: Handoff connection established (try 1 of 5) on fd 6, "/var/tmp/tmp.0.9OYerf". Sending message.
    Mar 1 00:43:51 n219073058253 org.x.startx[335]: Xquartz: Message sent. Closing handoff fd.
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: Xquartz starting:
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: X.Org X Server 1.4.2-apple45
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: Build Date: 20090705
    Mar 1 00:43:51 n219073058253 [0x0-0x22022].org.x.X11[327]: (EE) XKB: Couldn't open rules file /usr/X11/share/X11/xkb/rules/base
    Mar 1 00:43:54: --- last message repeated 1 time ---
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app Handing off fd to server thread via DarwinListenOnOpenFD(6)
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: DarwinListenOnOpenFD: 6
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: Calling ListenOnOpenFD() for new fd: 6
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: X11.app: Launching /usr/X11/bin/xterm:
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[0] = /bin/sh
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[1] = -c
    Mar 1 00:43:54 n219073058253 [0x0-0x22022].org.x.X11[327]: argv[2] = /usr/X11/bin/xterm
    ==========
    I quit the X11:
    ==========
    Mar 1 00:45:45 n219073058253 [0x0-0x22022].org.x.X11[327]: Quitting Xquartz...
    Mar 1 00:45:45 n219073058253 org.x.startx[335]: /usr/X11/bin/xinit: connection to X server lost.
    Mar 1 00:45:45 n219073058253 org.x.startx[335]: waiting for X server to shut down
    ==========
    AFTER quitting X11, I can see something related X11 is stilling running:
    ==========
    Mar 1 00:46:06 n219073058253 org.x.startx[335]: xauth: timeout in locking authority file /Users/Michael/.Xauthority
    ==========
    So what actually causes this problem?
    Thanks in advance!

    It turns out that there's something wrong about permissions.
    Here's the fix:
    (1) log in as the +root user+
    (2) type +chown -R Michael:staff ~Michael+
    (3) log out the +root user+
    (4) log in your account
    (5) done!
    Hope this thread will help those who encounter the same problem as me!

  • Where can I see the output of System.out.println for iWS 4.1 on NT

     

    I hope these two kb articles would help you to see the answer.
    http://knowledgebase.iplanet.com/ikb/kb/articles/4790.html
    http://knowledgebase.iplanet.com/ikb/kb/articles/4235.html

  • How use system.out.println with a Java Swing Applet?

    Hi guys,
    I was just wondering what can I use to view output on the Java console with a Java Swing Applet?
    At the moment I'm using a JTextArea within the Applet for debugging but I want output to appear in the browser java console but system.out.println doesn't work.
    I'm viewing the Swing Applet on Netscape 4.7 browser.
    Any ideas?

    System.out.println()s work fine! I'm guessing that your problem is that you are looking at the wrong console window!
    You're using the Java Plug-in, right? On Windows, go to your Control Panel and double click "Java Plug-in". You should find a checkbox option to "Show Java Console" - make sure this is checked. Next time you fire up you JApplet, you should see a Java Console window popup.
    Hope this helps!

  • How can I show a System.out.println(""); into a JSP?

    Is a simple doubt that would help me a lot to reach other thing that I wished reach with a JSP.
    Thank you!!!

    Hi!!!
    Thank you to answer me......my question�is because�my problem is a little more complicated��let me tell you�.
    My problem is that I wish to do some queries to a table of a Municipalities DB, I have read about that....and according with the exemples....my JSP...should be running and executing very well....but I haven�t had success with that...:(
    My JSP file is:
    <!doctype html public "-//w3c//dtd html 3.2//en">
    <html>
    <!-- Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.-->
    <head>
    <title>Query of Municipalities</title>
    </head>
    <body bgcolor=#FFFFFF>
    <font face="Helvetica">
    <h1>
    <font color=#DB1260>
    Municipalities List
    </font>
    </h1>
    <%@ page import="
    weblogic.db.jdbc.*,
    weblogic.html.*,
    java.sql.*
    " %>
    <p>
    <%
    Connection conn = null;
    try {
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:weblogic:pool:DESAPool");
    catch (Exception e) {
    e.printStackTrace();
    Statement stmt = conn.createStatement();
    stmt.execute("select * from cat_municipio");
    ResultSet rs = stmt.getResultSet();
    while (rs.next()) {
    System.out.println(rs.getInt("cve_municipio") + " - " + rs.getInt("cve_sepomex") + " - " + rs.getString("desc_municipio"));
    stmt.close();
    conn.close();
    %>
    <p>Please call Mary with any updates ASAP!
    <p>
    <font size=-1>Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
    </font>
    </font>
    </body>
    </html>
    My result obtained is the following:
    Municipalities List
    Please call Mary with any updates ASAP!
    Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
    I don�t obtain nothing.....is like DB table were without information......but in reality the DB table has information.....and I can obtain it with the following JSP:
    <!doctype html public "-//w3c//dtd html 3.2//en">
    <html>
    <!-- Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.-->
    <head>
    <title>Query of Municipalities</title>
    </head>
    <body bgcolor=#FFFFFF>
    <font face="Helvetica">
    <h1>
    <font color=#DB1260>
    Municipalities List
    </font>
    </h1>
    <%@ page import="
    weblogic.db.jdbc.*,
    weblogic.html.*,
    java.sql.*
    " %>
    <p>
    <%
    Connection conn = null;
    try {
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:weblogic:pool:DESAPool");
    // Fetch all records from the database in a TableDataSet
    DataSet dSet = new TableDataSet(conn, "cat_municipio").fetchRecords();
    TableElement tE = new TableElement(dSet);
    tE.setBorder(1);
    out.print(tE);
    } catch (SQLException sqle) {
    out.print("Sorry, the database is not available.");
    out.print("Exception: " + sqle);
    } catch (Exception e) {
    out.print("Exception occured: " + e);
    } finally {
    if(conn != null)
    try {
    conn.close();
    } catch(SQLException sqle) {}
    %>
    <p>Please call Mary with any updates ASAP!
    <p>
    <font size=-1>Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
    </font>
    </font>
    </body>
    </html>
    and with this JSP I obtain all the following information:
    Municipalities List
    CVE_MUNICIPIO CVE_SEPOMEX DESC_MUNICIPIO
    1 1 ACAJETE
    2 2 ACATENO
    3 3 ACATLAN
    4 4 ACATZINGO
    5 5 ACTEOPAN
    Now...I need that the first JSP work very well, because...with that way...I can do queries and obtain the needed results for showing them in the Browser......
    So, I already find out�.that�any string that I send to the browser with System.out.println(); isn�t showed�.so it is the reason of my question�..how I can see my results of a query using a loop (like a for, while) resolving it....I think my problem would be resolved.
    So...I hope you understand me, and you could help me please...thanks.....
    Mary
    P.D. I also attempted with the following JSP...but the result is the same....I don�t obtain none result...
    <!doctype html public "-//w3c//dtd html 3.2//en">
    <html>
    <!-- Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.-->
    <head>
    <title>Query of Municipalities</title>
    </head>
    <body bgcolor=#FFFFFF>
    <font face="Helvetica">
    <h1>
    <font color=#DB1260>
    Municipalities List
    </font>
    </h1>
    <%@ page import="
    weblogic.db.jdbc.*,
    weblogic.html.*,
    java.sql.*
    " %>
    <p>
    <%
    Connection conn = null;
    try {
    Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:weblogic:pool:DESAPool");
    catch (Exception e) {
    e.printStackTrace();
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select CVE_MUNICIPIO, CVE_SEPOMEX, DESC_MUNICIPIO from cat_municipio");
    while (rs.next()) {
    System.out.println(rs.getInt(1) + " - " + rs.getInt(2) + " - " + rs.getString(3));
    rs.close();
    stmt.close();
    conn.close();
    %>
    <p>Please call Mary with any updates ASAP!
    <p>
    <font size=-1>Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
    </font>
    </font>
    </body>
    </html>

  • System.out.println and log file

              I am developing jsp on BEA Weblogic 613 on Solaris.
              What if i run the following statement
              System.out.println("Hello world");
              I understand that Hello World will be printed to the server console. I do not
              have access to this console. Is there any log file or temporary log file it gets
              sent to? If not, is there anyway to redirect output from the console to someplace
              else?
              Thanks!
              

    You can redirect console output for stdout on Solaris like so:
              java weblogic.Server > consoleoutput.txt
              then in a terminal window you can see whats going on with
              tail -f consoleoutput.txt
              Sam
              Brian Schneider wrote:
              > I am developing jsp on BEA Weblogic 613 on Solaris.
              >
              > What if i run the following statement
              > System.out.println("Hello world");
              >
              > I understand that Hello World will be printed to the server console. I do not
              > have access to this console. Is there any log file or temporary log file it gets
              > sent to? If not, is there anyway to redirect output from the console to someplace
              > else?
              >
              > Thanks!
              

  • Linux System.out.println()

    I am porting some JSP's from Windows to SUSE Linux. These JSP's call functions that are embedded in JAVA classes, which in turn output error messages with System.out.println() to the console. It appears that in Linux, the bash Konsole doesn't print these errors, so they are invisible.
    I suppose that if I wrote JSP's in the future, errors could be printed in the browser, but I would really like to be able to see my errors in bash or which ever shell. Any help would be appreciated.

    If you ever intend to use more than one webserver, I would suggest you look towards something like JMS. Messages can be sent to the queue from which you can pick them up and deal with them as necessary in your own time, be that real-time or delayed.
    If you think you will never need more than one, why not write a little log file reader? Remember though that the catalina.out file will grow and grow unless you stop Tomcat, rename the old file and restart Tomcat.

Maybe you are looking for

  • "Adobe Premiere Elements 11 has stopped working"

    Hi, I have been having problems with getting Adobe Premiere Elements 11 to open. It was working fine for a year and then I haven't been able to get it to open. I have tried running the program as an administrator, uninstalling and reinstalling and de

  • Adobe bridge collections

    my internal drive has insufficient space for all my collection folders under favorites. is it possible to have all my collection folders on an external drive and if so how do I do this ? mac mini 2ghz dual core ,120gb hard drive leopard, 1 gb ram

  • Enabling VNC or Fire Wire booting

    Hello Mac People, Is there anyway to access "System Preferences" remotely? I need to check and make sure that "Remote Management" is enabled on a FULL XSERVE server running 10.4.11. I will be using a Mini-Mac also running 10.4.11; this is only going

  • I purchased Toy Story 3 on my old PC. I tried to find it in my purchased list on my new PC but I cannot find it.

    On my old PC, I have Toy Story 3 installed on my iTunes. But now I have purchased a new PC and scrapped the old one. I downloaded iTunes and re-downloaded all my previous purchases. But I could not see Toy Story 3 or any of my other movies there. Hel

  • Just Activated My Wife's iPhone...No Edge!!! Help!

    The Edge network does not show up at all. There is perfect edge network in the area that we are in, when I had an iPhone it worked fine. I do not know if this is of any help but, when the iphone is connected to our mac at the summary screen it lists