AVD not running - java

Today when I was doing my project using android studio, a blue screen suddenly appears and system get restarted automatically. And now when I tried to run my app using emulator, the AVD is not running and I get an error as below. Anyone faced this before ? How do I fix this?
ProcessNotCreatedException: Unexpected error while launching AVD:
Cannot run program
"C:\Users\tongws\AppData\Local\Android\sdk\tools\emulator.exe":
CreateProcess error=216, This version of %1 is not compatible with the
version of Windows you're running. Check your computer's system
information to see whether you need a x86 (32-bit) or x64 (64-bit)
version of the program, and then contact the software publisher
Wnen I click the Android Device Monitor, nothing happen also...

Found the following solution.
Go to the following directory in your computer:
C:\Users.android\avd
Inside this directory you will find all files and directories with the definition and content of your avd machines-
Now do the basic troubleshooting steps:
-check if the avd directory exists and if it contains a file with the name "sdcard.img".
-if the file exists, try to rename it (to check if its locked) and then go to eclipse and ask to create a new sd card.
-if it fails, try to create manualy a file with that name to check premissions.
good luck

You have a computer problem not related to AVD
ProcessNotCreatedException :Exception thrown when attempting to retrieve the result of a task that aborted by throwing an exception.
Because of their usefulness and ubiquity, EXE files are commonly used
as a method of delivery for virus / malware infection. Often, viruses
will be disguised as a benign EXE file (such as emulator.exe) and
distributed through SPAM email or malicious websites, which can then
infect your computer when executed (eg. when you double-click the EXE
file). In addition, viruses can infect, replace, or corrupt existing
EXE files, which can then lead to error messages when
related programs are executed. Thus, any executable files that you
download to your PC should be scanned for viruses before opening -
even if you think it is from a reputable source.
Read SO Answer .
What should you do
FORMAT Your System
Install Android Studio (Set Latest Version With Proper JDK Path)Note that you need to have JDK 6 or higher installed.
You can use Intel x86 Emulator Accelerator (HAXM installer) or Genymotion .
IF YOU HAVE MULTIPLE DRIVES, THE DRIVE WHERE THE OS IS INSTALLED IS
NEEDED TO BE FORMATTED, SO YOU SHALL LOSS ALL DATA OF THAT DRIVE. I
SUGGEST YOU TO TAKE A BACK UP OF ALL YOUR IMPORTANT DATA STORED IN
THAT DRIVE, INTO OTHER DRIVES WHICH WOULD REMAIN UNCHANGED. ON THE
OTHER HAND, IF YOU HAVE ONLY ONE DRIVE, THEN ALL YOUR DATA WILL GET
ERASED WHILE FORMATTING .

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

Serial link error and bad path jre 1.7.0_15 32-bi

Trying to make an old java game run on the original PC both ca 2012. JRE 1.7.0_15 (32bit) runs on linux (Puppy 6.3, 32 bit). I can configure the game with java but the next console command to start the game fails with
Exception in thread "AWT-EventQueue-O" java.lang.Unsatisfied LinkError: no serial in java.library.path
...and then more errors.
I don't know java or java syntax. Can you tell from this info what I can type in urxvt console so it finds the serial link? Java was installed clean with the Puppy Package Manager, although a few shared libraries report missing. I found those files in other parts of code and online, but have no clue what to do with them so they're found properly or if that's even the problem.
Mine seems to be a common noob issue, but because I don't know what mounts and where, even the right command will fail without typing the true folder names and addresses which I don't have. Can you tell from the error image? Thank you.

How to allow JAVA Web Start application to access file system on macOS Catalina if it is started by double clicking on JNLP file?

With macOS Catalina we are experiencing the following problem: opening Java Web Start applications behaves differently when application starts by double clicking on JNLP file and when it is started by double clicking on a shortcut installed on a desktop.
In the first case (double click on a downloaded JNLP file) application opens without permissions to access file system - trying to get the directory listing in user's Desktop directory in JAVA code always returns null. There are no prompts presented to the user asking for any permissions to access the file system. This is not an expected behaviour.
In the second case (starting it from desktop shortcut) user is first prompted that application is trying to access the file system and asked for a permission. When user allows application to access files - application reads user's Desktop directory properly. This is the expected behaviour.
Is there a workaround for this? How can we make web start application access file system on Catalina if it is started by double clicking on JNLP file (which is how the application must be started at least for the first time)?
I've run into a similar problem running a legacy .jnlp app. I was able to get around it by simply invoking the application from CLI (iTerm/Terminal/etc.) :
# javaws filename.jnlp
The root cause is that macOS 10.15 (Catalina) now requires non-Apple applications to be specifically granted "Full Disk Access" permission. Check out this and this for details. Using the explanation there, I added /usr/bin/javaws (and other java binaries such as java and appletviewer) to "Full Disk Access", but that didn't resolve the issue.
Based on an older thread, it seems that if the path to the application is not under /Applications/ (in this case, java and javaws are under /System/ and not under /Applications/), then Full Disk Access is not honored. So it's very likely that a fix needs to be provided by Apple to allow running these applications from the UI.
We were able to resolve this by granting Full Disk Access to /System/Library/CoreServices/Java Web Start.app
For me the problem was solved by installing a different version of Java.
I had the same issue on OSX Catalina 10.15.7. I was able to launch the jnlp file by first setting JAVA_HOME.
export JAVA_HOME=$(/usr/libexec/java_home)
javaws /path/to/file.jnlp

Failure of Windows Service to start under JavaExe : Updated

Is anyone having a problem running a Windows Service with JavaExe, and is there a solution?
The JavaExe examples all work except for the Service examples, Example3, Example5, and Example23.
In each case, the Windows Service gets created, but any attempt to start the service brings a popup error message:
"The system cannot find the file specified."
There is a registry entry for the serivce which contains the following:
Name: ImagePath
Type: REG_EXPAND_SZ
Data: "\JavaExe\JavaExe\doc\examples\3 - Service\Example3.exe" __RunService__
If I run Example3.exe from a command line with the argument __RunService__, then a Java process starts and runs briefly before crashing.
The examples are all self-contained in the JavaExe download, so it's hard to see how there could be missing libraries.
Background: JavaExe (http://devwizard.free.fr/html/en/JavaExe.html) appears to implement a sound approach to allowing a Java application program to be invoked from another Java program running as a service. Windows prevents services from accessing the desktop, so JavaExe sets up a socket connection between the service and the application Java program, each running as a User process, as outlined here:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683502(v=vs.85).aspx
Windows 7 x64 (but it fails in the same way on XP [SEE UPDATE BELOW])
Java version 1.7.0_45
--
UPDATE:
The developer replied to my email and advised that 32-bit and 64-bit Java versions were being confused.
I straightened this out. The Example3 Service, run from the .exe and .jar files obtained from the
JavaExe .zip download (which are all 32 bit by default), now run correctly on WinXP (x86).
For x64 machines, it is necessary to recompile the jar files using the package's compilx64.bat script.
(And to use the x64 versions of JaveExe.exe as stated in the documentation.)
I did these things but the Example3 service still fails to start, with the error,
"The system cannot find the file specified."
The .jar files built from compilx64.bat are mostly identical to the x86 versions, but a few
contain .class files that are a few bytes larger. I assume that the code must therefore be referring to native libraries? And maybe some are not found? But which ones?
When I type sc qc Example3 I get:
TYPE: : 10 WIN32_OWN_PROCESS
START_TYPE: 2 AUTO_START
ERROR_CONTROL: 1 NORMAL
BINARY_PATH_NAME : "[...filepath...]\JavaExe\JavaExe\doc\examples\3 - Service\Example3.exe" __RunService__
LOAD_ORDER_GROUP: 0
DISPLAY_NAME: JavaExe : Example3
DEPENDENCIES: eventlog
SERVICE_START_NAME: LocalSystem
Answer:
The filepath to the Example3.exe was on a network drive.
To get a Windows Service to run from a network drive is either impossible or requires considerable contortions. See for example,
Map a network drive to be used by a service
When I moved everything to the local C: drive, it worked.
Thank you to bb67 for providing the hints that led to figuring this out.

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