Run configuration with "-ws" argument unexpected behavior [message #1006117] |
Tue, 29 January 2013 19:48  |
Eclipse User |
|
|
|
Eclipse version:
Version: Juno Service Release 1
Build id: 20121004-1855
OS: OS X 10.8.2
I've developed a program which takes in the argument "-ws", so for the Run Configuration for it I have set the argument "-ws <myarg>" via the Arguments tab but this results in some odd behavior. Basically when I set that argument what happens is if I debug the first line of the main method the code is actually being executed in a daemon thread called "Thread-1" instead of the "main" thread. If I remove the "ws" argument then things work as expected and my main method is being executed by the "main" non-daemon thread.
Now, it looks like Eclipse supports a runtime argument "-ws" listed here but my understanding is this is a runtime argument that is passed when launching Eclipse itself, not a program launched from of Eclipse. This was my only guess as to why this may be happening, either some bug or I have to suppress that somehow.
To reproduce you can use the following code:
public class Test {
public static void main(String[] args) {
System.out.println("Thread Name: " + Thread.currentThread().getName() + " IS Daemon: " + Thread.currentThread().isDaemon());
}
}
Then add a Run Configuration that uses Test as the entry point and set a run argument of "-ws". This may only be reproducible on OSX, I only started seeing this issue when I got my macbook pro, I previously ran the code fine on a Windows box with no problem (although I can't verify again because I don't have the Windows box setup anymore).
|
|
|
|
Powered by
FUDForum. Page generated in 0.03367 seconds