I use the Java Console to debug / QA my company's products but sometimes I accidentally hit the "Close" button and in order to see the window again, I have to restart the entire application.
Is there an easier way to reopen the Java Console without having to restart the application?
Edit: I test the Java application on Windows, Linux, and OSX
I don't know how you would get this done in Windows , but you should look into screen.
To start your application:
bash$ screen
bash$ ./program
then if you accidentally close the window, all you have to do is:
bash$ screen -r
To detach from a screen you are looking at you need this key combination:
ctrl-a + d
^ This means press ctrl and a at the same time, then release keys and press d
the program should come to the forground so you can interact with it. I don't know if Max OSX comes with screen, but if it doesn't it can easily be installed using brew install screen.
Anyone who has more information on how you could do this in Windows, feel free to expand this post or post another answer.
Related
I am trying to create a desktop shortcut from my app, in oder to have my app icon on the user's phone desktop once he/she launched it.
I followed the instructions here in order to create a shortcut with 'shortcutManager.requestPinShortcut()'. It works, I manage to display the Google popup that allows to create the shortcut.
Nevertheless, due to the ShortcutManager API limits, I need to reset the API counter so that I can display several popups during the dev/debug phase.
I use the reset method mentioned here, that is to say:
Developer Options > Reset ShortcutManager rate-limiting
adb shell cmd shortcut reset-throttling [ --user your-user-id ]
but:
Method 1) doesn't work (doesn't seem to reset the counter as I still don't see the popup after reset)
Method 2) also doesn't work when I use 'adb shell cmd shortcut reset-throttling' without mentioning the 'your-user-id'. Indeed, I don't know what is the user-id.
How can I find this user-id ? If it still doesn't work, how can I do to display a popup each time I want during development ?
Thanks for your help.
I have Java version 8 Update 261 on a 64 bit Windows 10 system.
What I did:
downloaded and executed a jnlp file
the application was installed in the Java cache and a desktop icon was created
the application was starting
So far, so good.
Now, after closing the app and double clicking that desktop icon - nothing happens.
However, in the Task-Manager I see that the Java Web Launcher is running. And every further double click starts another instance of it, but on the screen I see nothing.
To get the application running properly again, I can either
clear the Java cache with hook at "installed applications and applets" set:
The desktop icon is removed, the above procedure can then be repeated and works like a charm.
or show the Java console
In this case double clicking the desktop icon works! The Java console opens and after some seconds the application is starting.There's no need to clear the cache anymore.
I understand that clearing the cache can solve manifold issues, but what effect has the simple "show console" here?
I try to make an application which must be full screen. But when i press CTRL+ALT+DEL task manager comes up. Even i disable task manager, at this time its error message comes up and make taskbar visible. Then user get the chance to go to the dekstop but i dont want user to get this chance. Only user could be able to go to desktop when it did what application wants from it. So i need taskbar keep bottom of other windows until user does what it should do. And i need to do this by my application which i try to code in Java
How can i change the status of task bar using registry?
Why not permanently disable the taskbar?
Follow this link to permanently disable the task bar.
You can edit .reg files in Java, follow This link to know how to edit .reg files
"But how can i do it by java without reseting the machine?"
As far as i came across, you have to reboot your system, no way out.
Ok i found it.
When i changed the value of 8th byte value of Settings variable to 10 in
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2
in registery
It just deselect the "Keep the task bar on top other windows" option
For applying the changes explorer.exe should be killed and re run
There are key strokes which Windows catches before they are sent to application and Ctrl+Alt+Del is one of those.
Regarding "Then user get the chance to go to the dekstop", if you set frame.setAlwaysOnTop(true);, user won't be able to switch to other any application.
You can use java's fullscreen API, and then use a Robot to force focus back to your application. See here: Java Full Screen Program (Swing) -Tab/ALT F4.
Good luck in whatever you are doing - it doesn't sound fun!
I own a game server and I was just wondering, instead of running the server in eclipse and then when I restart it, it opens a new cmd prompt outside of eclipse and runs the server on that. Could I make it so the program relaunches in eclipse as if I hit the green play button?
I was reading your comments on this post. You said that you don't want to kill the program and then restart from within eclipse. So you have two options.
Bad Answer: Just press ctrl + F11 (relaunch the application and ignore the old one)
Good Answer: Press F11 then go to what looks like a computer in the console tab. You can select the previous running program and kill it and the second one will still be running.
If what you want to do is transfer the data and keep it the same run time state, well to say the least that is going to be some what complex. I would make some kind of method to transfer all current data and call it from your constructor. Then start your second program and kill the original. I'm 90% sure all your users will get booted though.
OK, maybe I'm dumb/blind, but in the docs it says "rebuild and restart the server." But I don't see a button to do this anywhere. Or from any contextual menu. And I can't find anything in their docs explaining how to do it. If I just try to start the app again, it gets angry because I already have App Engine running on the needed port.
Only solution I've found is to restart Eclipse... any other ideas? A screenshot of a button would help if possible. :)
In eclipse, there is a view that contains your Console. If you click on that, you will see the STDOUT and STDERR output of your running application. In the upper right, there should be a red box that will terminate the currently running program.
I have a different and possibly more productive solution for you. Like with most web development environments you probably want to change your source code and have Google Appengine server reload the new code for you.
You need some version of the traditional "touch" unix command (if you work on windows you can download a version from here).
Then go to you project properties, Builders and add a new build step as a "Program". Under "Location" enter the path to your "touch" command ("D:\bin\UnxUtils\usr\local\wbin\touch.exe" for example - on Posix systems just "touch" should be enough since it's already in your PATH) and in "Arguments" put something like "${project_loc}/war/WEB-INF/appengine-web.xml".
Also go to the "Build Options" tab and check "During auto builds".
"touch" will update the timestamp in you appengine-web.xml. When the App Engine server detects changes to you appengine-web.xml it will reload the app automatically. The load process is very fast so it can be done whenever you change any file in your project (which normally triggers the auto-build in Eclipse) - you can tweak the builder to only run when you change certain types of files.
I might add that the "little red box" is not always visible. It drove me crazy reading that same instruction but not seeing the terminate button until I discovered that the Console windows has "layers" that you can select from using the drop-down button on the far right of the controls for the Console view. You just need to go "back" to the console screen that says the server is running and you will see the little red terminate button.
The previous answer wasn't cutting the cheese for me. Upon first starting App Engine, the red square would be available above the text entry area. If I then clicked the run button again, then red square would go away and the console for the previous launch would be replaced by the console for the new launch. To manually stop the App Engine server, you can kill it from the terminal:
http://geekbrigade.wordpress.com/2009/02/26/how-to-find-and-kill-a-process-that-is-using-a-particular-port-in-ubuntu/
In short, "sudo netstat -lpn |grep :8888" and kill the service by process ID.
Strangely, adding Google Web Toolkit to the project made my App Engine launch show up in the Development Mode pane, where it could be easily be killed or restarted.
Just Click on Debug perspective (should be on upper right panel), select the instance of web application on Debug panel (if you don't show it, you could enable by menu Window->show view->Debug) and click on red box of view menu.
The best I've found is to setup the keyboard shortcuts for the console's terminate button, and the run/debug start/restart command. By default, you can enable Command-F2 to terminate, and Command-F11 to restart, its fairly painless. Make sure to enable the full debug menu group (click on main toolbar -> customize, etc)
If you include the gwt SDK in your project, the gwt development mode box contains a reload server button that will work just fine.