Eclipse froze on me earlier today, so I typed "top" into the command prompt and killed it. Now when I try to run a java application, I get this error:
eclipse\plugins\org.eclipse.jdt.debug_3.7.0.v20110509
That's all that shows up under details.
None of my previously working programs run, and I have no clue what this is. I have Eclipse 1.5.0 running 1.6 and 1.7 Java, depending on what program. Thanks for any help.
It is possible that you killed part of the process but not all of it. It is possible that a java process is running with a reference to this job. I would try restarting your computer to see if it will stop whatever process is referencing that jar.
Aside from a restart, then another option would be to use (in linux) pstree, filtered for your user to see if any other jobs are referencing that jar and/or java.
EDIT:
Another path is to look at log files. On linux they are in /var/log. Here's a link in that direction: http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-Desktop/html/felog.html
Related
We are customizing the site generation in maven and one of the things that it does is call Visio to have it translate some charts into png. We use a vbs script which calls Visio and that is called from a java class by calling Process proc = Runtime.getRuntime().exec(command); where command is cmd /c "cd "C:\Path\To\Module\site\target\staging"&&exportVisioSvg.vbs "C:\Path\To\inFile.vsd" "C:\Path\To\outFile.png""
Now this code executes on my own machine just fine. Visio is called up and generates a file. When I run it on the server hosting our Jenkins instance it works as well. When I run the command by itself it works just fine. Finally when I goto the Jenkins\workspace and execute the maven build there it works just fine.
However when I run the build in jenkins with exactly the same command (I copied and pasted it) it does not generate the Visio charts. Everything else runs fine and there is no stack trace outside of our own thrown error that goes off when the image is not where it is supposed to be. The exit code from the process is 0 as well and there is no output to either stdout or stderr (the windows equivalent) generated by the process and it has to complete or the exit code would be -1. Timeout isn't a problem as it has 50000 ms to run but always returns within a sec or less (you can see the error get thrown right after the call to the script).
I switched Jenkins to run under the admin account where everything is installed (moving it from SYSTEM) so it should have access to the PATH.
I have no idea what to do at this point.
This sounds like one of the Jenkins FAQs. Check https://wiki.jenkins-ci.org/display/JENKINS/My+software+builds+on+my+computer+but+not+on+Jenkins especially under the section "Desktop access (Windows)"
You're probably hitting http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6468220 and since it can't be fixed in the JDK, you need to finetune it in your code.
The problem is when Visio is started it is started as a child of the Jenkins service which is running without desktop interaction. Microsoft restricts its office product actions where a prompt might be generated which cannot be seen by a user. Even if you add allow interaction with desktop it will not work and in my case returned the following error value 2032466051. The solution was to only run it as a user and manually start the Jenkins instance every time we needed to restart the server.
I am trying to run a simple JAVA program once per day on a Windows 7 machine.
My code runs fine inside NetBeans. If I do a clean and build it suggests this:
C:\Program Files\Java\jdk1.7.0/bin/java -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"
This does not work from the DOS prompt of course because of the space between program and files so I do this:
C:\Program Files\Java\jdk1.7.0/bin/java -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar" -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"
This works from the DOS prompt.
I now create a task in Windows Scheduler to run:
C:\Program Files\Java\jdk1.7.0/bin/java
with arguments:
-jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"
When I then run it, all I see is a DOS box flashing up for a second. I expect the code to take about 30 secs to run. The code should persist data to a database and no updates happen.
The code also uses java.util.logging so I should see log entries and I don't.
I strongly suspect that I am not running the JAVA command properly or that there's a bad classpath issue that it present when running via Scheduler that isn't there when running from the DOS prompt.
Help would be appreciated. If you've seen this before and can sort it that would be great. If you can tell me how to get a meaningful error trace from Scheduler than that would also be really helpful.
Thanks!
I Think that you could create a simple batch script that will launch your program in this way :
#echo off
REM Eventually change directory to the program directory
cd C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\
REM run the program
"C:\Program Files\Java\jdk1.7.0\bin\java.exe" -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"
Copy it into the notepad and save as java_script.cmd and then schedule this script instead of the program directly.
I solved it after changing all fonts' references to "SansSerif"
I was using Jasper Reports inside Java to create a PDF file. It was working fine when I double click the batch file or Scheduler with Windows Server 2003 but not working with the Scheduler of 2008.
I tried many different things nothing worked so I though Could it be that Windows Server 2008 is blocking the access?.
Now is working perfect. So, if you are having problems check the references to anything you are using.
The scheduler will run under a different user unless you specify what user to run as. If it isn't running as your user then it won't be able to write to your directories.
The real problem to the original question is a java installation issue on Microsoft systems. Java jre installs into Program Files\java. The executable (java.exe) is only installed in that java\bin directory. Running from the command line, the os looks in the proper location for the java.exe. Running from other MS tools (such as VBA Excel or in this case TaskScheduler), it does not!
You can see that TaskScheduler is looking in the wrong place by viewing the tasks history in the TaskScheduler tool. Double click on some of the history events and one will list the action and return code. The action will show that the TaskScheduler is trying to run
"C:\Windows\system32\java.EXE"
So, copy java.exe from the java\bin directory into the place where the scheduler is looking, and now it will work.
Or update your task and provide the full path to java.exe.
You can also update the environment system path to look for java in the java\bin directory, but that has to apply to all users and sometimes this is faulty as well.
I've created a simple 1 file java application that iterates through a loop, calls some functions, allocates some memory, adds some numbers, etc. I run that application via eclipse's Run As->Java Application.
The running application shows up in Java VisualVM under Local.
I double click on that application and go to the Profiler tab.
The default settings are:
Start profiling from classes: my.main.package.**
Do not profile classes: java.*, javax.*,
sun.*, sunw.*, com.sun.*
I click on CPU. The CPU and Memory buttons gray out. Nothing happens.
The Status says profiling inactive.
When my application terminates the Status says application terminated.
What am I doing wrong here? Are there some settings I need to tweak? Do I need to set a VM flag when I launch my application?
I had the same issue after java 1.7.0_45 update. I had to delete the following folder:
C:\users\'username'\AppData\Local\Temp\hsperfdata_'username'
After doing so, everything works like a charm.
I'd guess the issue relates to the application being started from within Eclipse, this is because JVisualVM expects to find data in the java.io.tmpdir directory (usually C:\Users\[your username]\AppData\Local\Temp\hsperfdata_[your username] on a Windows system).
I assume rather than in the normal location where JPS, JVisualVM etc. expects it, Eclipse puts the data in it's own temp folder?
If so, try invoking JVisualVM using jvisualvm -J-Djava.io.tmpdir=[Eclipse's temp directory] to explicitly tell it where that data is.
If you can't find the hsperfdata_$USER folder, try just running your application outside Eclipse in the usual command line Java way.
Also note that there was a bug affecting the temp folder (case sensitivity) introduced around 1.6.0_23, so maybe you'd benefit by updating to a more recent Java 6 (or 7) build?
Mikaveli, Kuba and Somaiah Kumbera have provided great solutions. Just adding what I have done to make things work.
I first checked the location C:\users\'username'\AppData\Local\Temp\hsperfdata_'username' There was no file named with the process ID of my program running inside eclipse.
I simply stopped the program and added the following parameter to the Run Configurations of the program (Run Configurations -> Arguments -> VM Arguments)
-Djava.io.tmpdir=C:\users\'username'\AppData\Local\Temp\hsperfdata_'username'
I started the program again. Still could not profile it. But now I have a file created for the process at the given temp directory.
Then, a simple restart of VisualVM did the trick.
I had the same issue, but with the following symptoms:
I started jetty, with the work directory in
C:\Users\t852124\AppData\Local\Temp
Jetty was creating the hsperfdata_ directory but not setting a processID in it
So when I started visualVM, it could not get any java process info.
I solved this by starting jetty with the -Djava.io.tmpdir=C:/temp/java option.
Now when I started jetty, the process ID was created as a file in the hsperfdata_ directory.
So when I started visualVM, it was able to see my local java process
I had the same problem and running VisualVM with elevated privileges (admin rights) solved the issue.
On Linux with VisualVM 1.3.3 I have to remove local settings of application in ~/.visualvm/1.3.3/ to enable CPU Profiler and CPU Sampler.
Also note that /usr/bin/jvisualvm contains hardcoded path to OpenJDK (set with jdkhome variable), which seems to cause a lot of issues, comparing to running to Oracle JDK 1.7.
Also note that if your application is using a recent non-Oracle JVM, you may need to download the "bleeding edge" VisualVM from github.
For example, the VisualVM bundled with JDK 1.8.0.111 doesn't seem to work with the IBM 1.8 JVM. Possibly the IBM JVM was simply released after the Oracle 1.8 JVM, so including the necessary changes wasn't possible at that time.
I had installed Java in my PC and it was working perfectly. Suddenly something went wrong and now I m not able to open swing applications and its showing the error 'Java not found'. But I can run the Eclipse IDE which also needed Java to run. So I decide to reinstall the Java, but when I tried to uninstall the Java it shows the Error 1723 - There is a problem with this Windows Installer Package. So I have installed a new JDK in another location and set the PATH. Still I am not able to run the Swing application.
Can anybody help me on this?
How are you running your swing application?
If it's from the command line like java mySwingApp and you're getting java not found then your PATH isn't set properly. Make sure that the java/bin directory is on your PATH not just the top level directory. You can test your PATH by just typing java in a console window - it should print the java help page.
If you're not running from a terminal like above, then you may need to set a JAVA_HOME environment variable which points to your java installation folder. Here's a tutorial on setting JAVA_HOME
Setting JAVA_HOME
Hope this helps,
Will
This is close to jakob's answer, about trying to get your Java install setup correctly again, just with a little more detail.
I had a similar problem on my Windows 7 box where I was trying to uninstall Java and do a clean install of a newer version. Something got messed up and I would get the 1723 error message during the uninstall and attempted reinstall. Here's information about how I was able to fix the problem, and maybe this will help you:
Look at the log files for the uninstall/reinstall. On Windows 7 they can be found at c:\users\username\AppData\Local\Temp\
The java_install.logdidn't show any extra information, but I had several MSI##### log files that contained error messages about the failed uninstall. The message was: Error 1723.There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action UninstallJRE, entry: MSIUninstallJRE, library: C:\Program Files\Java\jre6\bin\regutils.dll
There was indeed no regutils.dll file, and not even the bindirectory was there. So I copied over a regutils.dll file from another computer, ran the uninstaller, and it worked. Then the new clean install of Java also worked.
So take a look at your logfiles and hopefully that will give you more detailed information about the 1723 error.
This usally happens when you delete Java files manually.
If you try to uninstall Java and it fails, it generates a log file.
Should be in C:\Users[Username]\AppData\Local\Temp
Almost at the end the missing file(s) can be found.
Try to copy that file(s) from a working installation to your computer.
Then you should be able to uninstall your Java and install a new version.
I've run into a weird problem today. I'll try to describe the steps I'm making as detailed as possible.
I've created a Java application in NetBeans. The application runs without exceptions when running within NetBeans by clicking Run Main Project. The total duration of a complete run is about 1min.
When building the project I see the following option in the output window of NetBeans:
To run this application from the command line without Ant, try:
java -jar "C:\java_libraries\PrxJobCommunicator\dist\PrxJobCommunicator.jar"
So i open the command prompt (Windows 7), enter this command + supply a mandatory integer argument and press enter
The application starts running, runs for a couple of seconds and exits without any message whatsoever.
the application writes to a text file at different points in the code, so I'm able to trace the output up to the point when it stops running. I've deliberately put some extra calls to the file writer method in order to find where the programme continues/exits but to no avail. Seemingly the programme simply stops running on a certain line and that's it.
I really don't know what the problem can be: the application runs fine in NetBeans and fails without any message whatsoever when starting from the command line.
Shall I check anything special in NetBeans? Do you know of any special technique to debug a jar file if it's started from the command line?
Any clues are welcome.
Thanks, Andras
I suspect that there is a difference in the classpath when the app is run from NetBeans, and when it is run from the command line.
There must be some kind of exception that is being thrown, have you got an outermost
catch (Exception ) block in the main method?
You could try to debug the application using "remote debugging", although you won't be debugging over a network, you can still use this method to catch the breakpoint started at the command line in NetBeans.
Here's an article that explains how to do remote debugging with NetBeans http://manikandanmv.wordpress.com/2009/09/24/debugging-java-applications-with-netbeans/
Netbeans by default uses your project folder as the working folder. It means when you run your program from console you have to CD C:\java_libraries\PrxJobCommunicator
then run java -jar "C:\java_libraries\PrxJobCommunicator\dist\PrxJobCommunicator.jar"
If above fails check the java version used in your command prompt. java -version
It has to be same as the one used by netbeans.
Finally the library path. Are all the dependent jars placed in the dist folder?