We have a java applet we are running inside our company, but due to "reasons" the java consoles icon (in the tray) is deactivated by default in the java control panel.
Whenever a user has a problem we cannot really help him since there seems to be no way to open the java console afterwards. Activating it in the java control panel only activates it for newly opened java applets.
So is there any way to open the java console programmatically from within our own java code?
Searching for this problem only gives me lots and lots of hits for opening a normal cmd/bash console.
My Java application built using Netbeans platform application. I need to run my application without a GUI.
Anyone knows a way to run Netbeans platform application without a GUI ?
Information gathered largely from How Can I Make My NetBeans Platform Run in GUI or Command-Line Mode? :
you will typically need to add a module to interpret some custom command-line arguments using the Command Line Processing API
Remember that you should not use System.out, System.err and System.in for the output, error and input streams in the options processor but instead get them from the Env object passed as a parameter to the process method.
When running a platform application which contains the Window System and other GUI modules, you will also need to specify --nosplash --nogui on the command line at startup to prevent the splash screen and window system from being displayed.
At work we use a Personnel Administration System that uses Java Web Start.
We use Java 8.40, Internet Explorer 11 and Windows 7. Mostly 64-bit Windows but some 32-bit.
The computers with Windows 7 32-bit have trouble starting the application every morning. They have to try between 2 and 10 times before the application starts. Once they get in they can close the application and it will start without any problems.
Chrome usually works a little better but there is a policy at work that IE should be used.
I have followed Oracles Java troubleshooting guides and other online resources without any luck.
I have i.e.:
checked Anti-Virus and Firewall configuration.
made sure that Java is activated in the browser
checked different configurations in Java Control Panel
removed temporary files in IE and Java Control Panel
I've made sure that we use 32-bit JRE
tested to run IE without add-ons
and a lot of other stuff
This link is one of the more useful ones I've found on fine tuning Java.
When I choose to Show Console in Java Control Panel and enabled tracing and logging, this is what happens when the application doesn't start:
the console appears and starts to log events
the console suddenly closes
Java loading image never appears
Java and Windows log files don't show any errors.
Although Java seems to crash there are no error files (hs_err_pid*) to be found anywhere. I've searched the whole disk and even tried to set the JVM parameters to set a path for the error file (thanks Saeid)
I've also run Process Monitor during the start of the application with filters on jp2launcher process and the path of the Java cache folder but that didn't give me any useful information.
I want to emphasize that the application eventually starts. The 32-bit users just have to try several times. The 64-bit users don't seem to have any problems.
This is what Process monitor shows at the moment when the Java Console Window abruptly closes:
This is what the trace file look at the same moment:
and the log file:
I have a Java application ready to be deployed. I tried using Java Web Start (JWS) to launch my application. My application was able to launch it loads the MainFrame but some of the functionality does not work. For example my search button (which creates a new thread to search information over the internet) is not working and several other buttons. My application works perfectly as intended when I run it using the typical java -jar or by double-clicking the JAR file. Do you have any ideas why did it happen? Or am I using a wrong technology for deployment? When I read about JWS the thing that I really like is the auto-updating of the application when new versions are released for the app. I really want this feature for future updates.
Solved:
I wasn't aware of the of Web Start Console. My problem is solved now as I was able to see the stack trace. It has something to do with permissions and my JAR file being unsigned.
I found a bug in an application that completely freezes the JVM. The produced stacktrace would provide valuable information for the developers and I would like to retrieve it from the Java console. When the JVM crashes, the console is frozen and I cannot copy the contained text anymore.
Is there way to pipe the Java console directly to a file or some other means of accessing the console output of a Java application?
Update: I forgot to mention, without changing the code. I am a manual tester.
Update 2: This is under Windows XP and it's actually a web start application. Piping the output of javaws jnlp-url does not work (empty file).
Actually one can activate tracing in the Java Control Panel. This will pipe anything that ends up in the Java console in a tracing file.
The log files will end up in:
<user.home>/.java/deployment/log on Unix/Linux
<User Application Data Folder>\Sun\Java\Deployment\log on Windows
/~/Library/Caches/Java/log on OS X
(If you can modify the code) you can set the System.out field to a different value:
System.setOut(new PrintStream(new FileOutputStream(fileName)));
If you are running a script (invoking the program via java) from Unix you could do:
/path/to/script.sh >& path/to/output.log
In Mac 10.8.2 logs could be found at /Users/<userName>/Library/Application Support/Oracle/Java/Deployment/log/.
Before you have to enable logging from Java Control Panel. Option "Enable logging" is at tab "Advanced". Java Control Panel could be started from "System preferences".
A frozen console probably means a deadlock (it could also mean repeated throwing of an exception). You can get a stack dump using jstack. jps may make finding the process easier.
try this guide it works for me. it also guides you that how you can set "System.setOut(fileStream);", "System.setErr(fileStream);"