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?
Related
I'm developing a swing based Java application (Java 8) for Mac and Windows. Some users have set the mac system preference under "General" "Prefer Tabs when opening documents" to "Always" or "Full screen". When the setting is set to "Never" it works without problems.
This setting causes some weird state in which the window opens a new tab which results in a frozen application which can only be force quitted. I cannot assume that users know about this hidden setting in the Mac OS system preferences.
Three solutions would work for me:
Find any workaround to prevent the window from opening other windows as tabs?
Launching our bundled Java app with some -flag that disables this behaviour for the entire application
Detecting if this mac system setting is enabled and then warn the user and quit the application (not really a good solution)
This change in Big Sur is causing a bug in Java https://bugs.openjdk.java.net/browse/JDK-8256465
There is a workaround from MacOS terminal window you can run
defaults write net.java.openjdk.cmd "AppleWindowTabbingMode" manual
or if you have java bundled within your own application use the value of CFBundleIdentifier in the applications Info.plist file
e.g
defaults write net.myapp.com "AppleWindowTabbingMode" manual
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.
As stated in the title, my software won't launch unless the "Show console" option is selected in Java settings. I'm not sure what kind of code you'd like me to post, so please ask.
When I try to run it, the Java dialog pops up and the progress bar that loads the software completes before it closes. When the console is up, the software finally loads and displays afterwards. Without the console, nothing happens.
I've tried to run the web start on different computers, and they all had the same problem. The console doesn't print out any error messages, so I don't have anything to use for debugging the problem.
Some information about the software:
It's a JavaFX project, compiled using Oracle jdk 1.7.0_65 on OS X with Netbeans. It requires full security permission, and all jars (I use a bunch of libraries) are being signed using a key store from a trusted vendor.
EDIT
I tried to launch my program through console using the following command: javaws -viewer http://www.website.com/software.jnlp, and - without launching my software - it returned the following result to the terminal:
java.lang.NullPointerException
at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1003)
at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:998)
at sun.awt.SunToolkit.getSystemEventQueueImpl(SunToolkit.java:993)
at java.awt.Toolkit.getEventQueue(Toolkit.java:1749)
at java.awt.EventQueue.invokeLater(EventQueue.java:1245)
at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1290)
at com.oracle.deploy.update.UpdateCheck.updateStateChange(Unknown Source)
Could this be of any help?
For others who might have this problem, this is what caused it for me:
I had a thread running in the background that would show the stage once it was done loading all the assets. This stopped the whole thing from executing, so I had to change the loading logic inside of my code instead to allow for the primary stage to use the show-method in the UI-thread.
We had to write a Java application which runs on a windows 8 tablet (not RT).
I would much rather have written it using C#, but we really didn't have a choice.
Basically, we use launch4j to wrap our installer executable JAR in an EXE which then installs the appropriate application files and creates shortcuts on the desktop and in the start menu programs folder to ensure that the user sees the icons on the metro start screen.
The Problem
When the application starts up, it checks if any updates are available via a server, if they are available they are downloaded.
The issue that we've seen is that if the application is downloading the updates, and then we turn off the screen and leave it off for at least 30 seconds, once we turn the screen back on, the application is frozen and does not progress.
We then have to kill the app and start it again.
Providing the screen is not turned off again, the downloads finish and the application works fine.
Is there a way to either keep the screen on, keep our process running or detect when the screen comes back on and execute some code when that occurs?
Any help would be greatly appreciated.
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.