JAR issue on Windows 2003 - java

I have an application (myapplication.jar) running on Windows 2003. The application was running fine few days back on this server.
I am using a bat file to execute the Jar applicatin, for some reason it stopped working on it and I am unable to find the why?
If I copied the same folder to another server where JRE is already installed it works without an issue.
Cansome suggest me how do I find what is the issue. I have already checked the file type association, delete the temporary files (java cache and temporary files in windows)
Thanks in advance!!

Without any log, exception or stack trace it will be impossible to know what is causing the problem. Open the bat file in an editor and add at the end of line that starts with:
java -jar yourProgramBundledInA.jar > yourApp.log
this is going to redirect the console to yourApp.log file. Save the bat, run it and then look up the content of yourApp.log. There should be a clue why the application is failing.

Related

Working Application Stops Working With 'Main Class Not Found On'. No Changes have been made

I have an application (written about 10 years ago by someone else who is retired) that resides on a Stand-Alone Windows XP PC.
It was devleoped using NetBeans (Currently we have 6.9 installed on the PC) and controls a testbench for running component testing.
The application, initiated by a batch file on the desktop, has functioned perfectly well for Approximately 10 years.
However, 2 days ago it just stopped working with a message
'File Not Found' with the correct path and filename to a Config File that resides in a directory on the PC. This file exists.
I tried to run the application from the Dos command line (in the DIST ribution directory) using
Java -jar “AdBlue.jar”
This resulted in an error message being returned
'Exception In Thread "main" java.lang.UnsupportedClassVersionError ..... Could Not Find The Main Class"
No changes have been made to the PC.
It is the same Operating system (Windows XP - Shortly To Be Upgraded)
The java version has not been changed
The application has not been changed
The config file is still in the same directory
The permissions on the Config file have not been changed
I have checked Properties/Run and 'AdBlue.Main' is selected.
I am at a loss.
I would appreciate it if someone could point me (Someone who has not used java and Netbeans before) in the right direction. The test bench has come to a stand still and it will affect out production line shortly
We have found that teh file being searched for is corrupt.
It has been recreated and appears to have solved the problem
Thanks for all of the replies
Kind regards
Iain

File created from within my Eclipse does not have read permissions

A weird question:
I am running eclipse on windows and I am trying to open a file with a hard coded path:
String inputFile = "C:/temp/abc.txt";
File folder = new File(inputFile );
When I run this I get error:
java.io.FileNotFoundException: C:/temp/abc.txt (The system cannot find the file specified)
I have local admin rights on this windows 10 machine. I have tried running Eclipse as a Administrator but it doesn't resolve the issue.
The only way I can get by is if I traverse to C:/temp/ in cygwin and do a chmod 777 * . Then my program is able to open the file okay.
The work around should be fine if I was just reading a simple file but I am also creating files from within my java project which it does successfully create but then when it comes to reading them it fails.
myFile.setReadable(true); // doesnt work either.
Is this some sort of windows permissions issue ? Could it be that cygwin has taken over some admin rights on the file system? I have tried stopping it but the issue persists. Or is this an eclipse setting?
Many Thanks,
-A
It was a windows permissions issue.
Right click on the folder -> Properties -> Security -> Edit -> Add -> Everyone.
I dont understand why I need to add every one if I am the local admin and I launched eclipse but frankly I dont care about the bizarre world of windows.
Thanks to all those who tried helping.
Cheers
check this.
Permission Denied: File Creation in Java
https://www.mkyong.com/java/how-to-set-the-file-permission-in-java/

Tomcat startup batch issue

Can anyone please explain the below problem.
I'm using tomcat 8 and when I'm trying to start startup.bat file, the command prompt is opening and closing immediately just like blinking. However in the past while I'm working with java programs it worked fine but recently I installed Xampp and there in it again tomcat is downloaded "C:\xampp\tomcat". The same problem comes here in this folder as well, when I try to run startup.bat file. But when I use "XAMPP control panel" to start the Tomcat its able to get start and I'm getting "localhost:8080" start page in the browser.
The connector port for both tomcats are 8080 and I tried with changing the port number in tomcat 8 but no use. There should not be 2 tomcat servers in a single system? If not, why? (I've not installed them, both are in C drive)
I want to work with java servlet programs now.So I need use of tomcat. I've set below environment user varibles:
JAVA_HOME to C:\Program Files\Java\jdk1.8.0_65;
path to C:\Program Files\Java\jdk1.8.0_65\bin;C:\apache-maven-3.3.9\bin
Please suggest the solutions.
Thanks in advance.
I think you should check the tomcat log to find some clues, it is in log folder of your tomcat installation folder. Maybe you have missed some startup variable in start.bat for your new installed things.
BTW, if you want to keep seeing what happened in startup, try to run startup.bat in a command line console, but not double click it through your mouse. It will continue on generating log output in that console.

/opt/IBM/WebSphere/AppServer/java/bin/java: No such file or directory

I am running python file to start HTTP server in WebSphere but suddenly its searching java in some wrong location Then I stopped server and trying to start by startNode.sh shell script but its not starting server and giving same error its searching java in /opt/IBM/WebSphere/AppServer/java/bin/java.
previously it was fine even I set the java class-path in bash_profile.
When I try to run the file ./startNode.sh or ./startManager.sh its giving error.
ERROR CODE:
/opt/IBM/WebSphere/AppServer/bin/startNode.sh: line 151: /opt/IBM/WebSphere/AppServer/java/bin/java: No such file or directory.
How can I specify the path so web-sphere server can take it correctly.
Thanks in advance.
The paths in WebSphere are managed by the managesdk command.
The startNode.sh script not working seems to indicate the install was modified by either moving the JDK or changing a script to point elsewhere.

Java is not working in my PC

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.

Categories

Resources