Java is not working in my PC - java

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.

Related

Terminal searching JDK in wrong PATH/Build failed, debugger for java

Error: could not open `D:\IntelliJ IDEA Community Edition 2018.2.5\JDK\lib\amd64\jvm.cfg'
I get this error every time I try to run a java program. Before it was working fine when i had JDK 8 but i upgraded to 14. I use VScode and I had deleted Intellij but the file path hasn't gone and the terminal is trying to find the intelliJ JDK for some reason. I am a beginner to terminal too. I have tried setting up the environment variable for the correct path but that isn't working.The path variable doesn't have the intelliJ reference in it and i have even set up the JDK_HOME but even that isn't working.
Edit: I have downloaded a extension called Terminal Manager but don't know how to configure it.Will it work?(Edit: It doesn't, it's not what i thought it is used for)
Yet another edit: Is there a way to specify the path for JDK every time I use java commands in the terminal and does it have auto-completion(using tab). Should i just reset my machine because i can't seem to figure out this problem.
Where java in the command prompt gives C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe, not the path for the JDK 14. I updated the environment var path to point to the latest JDK but now i get INFO: Could not find files for the given pattern(s). in the command prompt.
In VScode, on opening the Configure JavaRuntime,That is showing me 4 paths, 2 are the correct ones(one is labelled current), one empty and the invalid path. I can't seem to find any way to remove the incorrect one. Though it has the correct path, it still searches for the deleted file.
Update: The program now compiles but every time it shows:
Build Failed
Debugger for Java
Proceed Fix Cancel
I click fix and clear the workspace cache but it doesn't work. It runs without the debugger but it would be better if it worked.
Install the "choose runtime" plugin this will allow you to select the runtime your self.
Start the IDE, use (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Choose Runtime", press Enter.
You will be able to download the latest version from here and it will be automatically configured to the config path

Installing Elasticsearch 5.0.2 on Windows 8 - \config\jvm.options "was unexpected at this time"

I'm new to Stack Overflow (though a long time lurker).
I'm struggling to install elasticsearch on my laptop. It's windows 8, I've just updated java to Java 8 and I've set the new path using set JAVA_HOME.
However, whenever I try to run the elasticsearch.bat file on the command line, I get this error:
\elasticsearch-5.0.2\bin\..\config\jvm.options was unexpected at this time
Any help would be greatly appreciated on this matter
I've also tried to setup the ElasticSearch on my Windows 2016 R2 Datacenter (64-bit). Let me share some of my experiences on how to solve this.
Setting up JAVA_HOME
Ensure that you have JDK/JRE installed. You can download it here.
Set the JAVA_HOME environment variable. To do this, open the Start menu and type in "path".
Then click on Environment Variables. If you don't have JAVA_HOME variable set yet, click New.
The JAVA_HOME variable should only lead up to the JDK/JRE directory, not including /bin.
C:\Progra~1\Java\jdk1.8.0_112
Progra~1 corresponds to Program Files. If you use Program Files (x86), change Progra~1 to Progra~2
Restart your computer. Once your computer is restarted, open up CMD and type in echo %JAVA_HOME%. The output should be
C:\Progra~1\Java\jdk1.8.0_112
If you get the following output, your JAVA_HOME is setup correctly.
Running ElasticSearch
The first time I tried to run ElasticSearch, I get the following output.
The odd directory I pointed out here gave me a hint that the batch file might be reading from the wrong directory. So what I did was tinker around with the batch file a bit. Open elasticsearch.bat using any text editor.
Scroll all the way to the end, somewhere above the last lines you'll see something similar to the following.
Remove the highlighted line, save the file and try running the batch file again via command prompt.
It works in my case.
Once you have this, open up your browser and navigate to localhost:9200.
I think that's it?
Your problem is most likely caused by parentheses in the path to where you unzipped and are running Elasticsearch from. The related issue in the Elasticsearch repository is #24712 which will be fixed with Elasticsearch 5.4.1.
Be aware that by applying Nicholas Lie's "fix" you are telling Elasticsearch to effectively ignore all settings in config/jvm.options. While this may help you to start Elasticsearch in this specific case, it will only start with default JVM options which might lead to surprising behavior down the road.

WinRun4J service example doesn't run

Does anyone know how to get the WinRun4J service example (ServiceTest class that is distributed with the software) to run? I'm on a Windows 7 box, 64 bit, and have the Java 7 JDK and JRE installed.
I performed the following:
Copied WinRun4J64c.exe to C:\test, renamed it service64.exe
Copied service.ini to C:\test, renamed it service64.ini
Finally, I copied WinRun4JTest.jar to C:\test.
First off, you have to run a command prompt as Administrator, otherwise you can't register the service. So in a command prompt, opened as Administrator, I entered the command:
C:\Test>service64.exe --WinRun4J:RegisterService
So far so good. But when I go to the Windows services panel to start the service, I get the error:
"Error 1053: service did not respond ... in a timely fashion"
Any ideas?
Thanks
I had the same problem. You need to also copy WinRun4j.jar to the directory as well or somewhere where it can be found in the classpath.
As far as I have understood that you may have forgotten to copy WinRun4JTest.jar to the C:\test.
You may also want to check that you have the appropriate java JRE installed for the 32 and/or 64 bit version of WinRun4J.
A quick way to find this out is to enable logging by adding the following to service.ini:
log=C:/log.txt
log.overwrite=true
And the log should note if your issue is JVM related.
Did you set JAVA_HOME? I was having the same problem and that solved my issue.

After uninstalling JPfofiler ( from Ubuntu ) when i run my application in Netbeans,it shows Error

I installed JProfiler, after 2 days i uninstall Jprofiler (in Ubuntu) but when i run my application Netbeans IDE shows following Error:
Error occurred during initialization of VM
Could not find agent library /home/bsoft/jprofiler7/bin/linux-x86/libjprofilerti.so in absolute path, with error: /home/bsoft/jprofiler7/bin/linux-x86/libjprofilerti.so: cannot open shared object file: No such file or directory
Please help me to solve this problem.
Finally i solved the problem.
i just removed two files(startup_jprofiler.sh, setenv.sh) from my tomcat installation directory(/var/lib/tomcat6/bin).**
Please first make sure that, your JVM is working or not. Try to start JVM from command prompt. It you are able to launch java.exe file then there are some problems with your project.
You are using netbeans. So before starting netBeans remove cache of netBeans. There are changes that your netBeans is pointing to old class path of jProfiler.
Regards,
Gunjan.

re install Jdk1.6 in windows 7?

I have installed jdk1.6 in E: drive of windows 7.I developed a simple .java file and try to run it through the command prompt using "javac" but it says javac is not recognized as internal or external command.So i checked just by running java it runs fine .so I thought that i should uninstall that jdk and reinstallit but i am getting windows 1723 error
opened a control panel and tried to remove jdk from there but got this "Error 1723.There is 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"
to be able to run javac from the command line, you need to add the path to javac to the PATH environment variable.
It looks like the 1723 error describes a problem with the installer itself. I would follow the advice from Microsoft Answers and Oracle to fix the installation. A correct install of Java should add the necessary entry on the Windows PATH. Make sure you open a new DOS (or Command) window after installation otherwise the amended PATH might not be picked up.
Probably,you are facing the below issue: https://forums.oracle.com/forums/thread.jspa?threadID=2213081. You can use ccleaner to uninstall all the instance of jdk/jre.The issue is happening due to interrupting in installing/uninstalling.If ccleaer is not solving your problem registry cleaning is the only option as shown on the above link.
You probably have java.exe on your \windows\system32 folder... And since this folder is on the path env var it got confused. Try to delete this/these java*.exe files from \windows\system32 folder.
If you encountered a problem with Java error 1723 when you try to reinstall Java.
It may occur when you delete the Java directory by error
_ Go to your Microsoft Event Viewer you'll see one error line like this
Event viewer
_ Then copy an Java bin directory from an other server to have back the lost dlls in the directory mentioned in the events viewer
_ finally reinstall Java
Hope it helps
I have used Microsoft utility(fix-problems-that-block-programs-from-being-installed-or-removed) to resolve this error it saved me doing manual work and it is safe also :
https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed

Categories

Resources