I am doing some Java development on Windows 7 x64 running inside VMWare Fusion 3.x (OSX). I have installed JDK6 (update 26), set JAVA_HOME to the path (no trailing slash), and restarted my command prompt.
I can successfully launch the program. During startup it runs the calibration and then fails with this error:
"Could not create directory\VMWare-host\Shared Folders\ .nbprofiler" (no space after that slash but the markup was hiding the period)
I can click to continue, but when I'm in the program I cannot do CPU or Memory profiling. I throws up a similar error box:
"Error retrieving saved calibration data for target JVM: Could not create...(same as earlier)"
Once upon a time I had this working by passing the --userdir flag and -J-Dnbprofiler.home during startup, but that trick isn't working anymore.
(The complete command was:
jvisualvm --userdir c:\Users\myname -J-Dnbprofiler.home=c:\Users\myname
)
How can I force jvisualvm to save its calibration data on a "real" drive instead of the vmware network drive and get this working?
.nbprofiler directory is derived from user.home system property. I am not sure what you did to Windows installation, but your user.home points to directory\VMWare-host\Shared Folders. So one solution is to fix the Windows installation, so that Java recognize c:\Users\myname as your user home directory. If that fails for some reason you can use nbprofiler.home property to override it, as you correctly wrote. However you should point it to the nonexistent directory, so you should start VisualVM with the following commandline:
jvisualvm -J-Dnbprofiler.home=c:\Users\myname\nbprofiler --userdir c:\Users\myname\visualvm_userdir
One last note, even if the profiler part is not working, you should be able to use sampling in the 'Sampler' tab.
Try disable Sharing for the VM.
It works for me with Windows 7 x86 in Fusion with Sharing disabled (and Sharing is the mechanism providing the folder you cannot write to).
I found the following command works for me.
visualvm -J-Duser.home=%HOME%
Also, I needed to add -Duser.home=%HOME% to my app startup command.
I had defined nbprofile.home and userdir, but I was still getting an error when the Profiler was running against my app: Profiler Agent Error: Could not create directory\vmware-host\Shared Folders.nbprofiler.
I discovered that the Profiler was using user.home defined by my app rather than the one with visualvm. Both seem to be needed.
Related
We're experiencing a strange issue - has anybody seen anything similar?
We have a Java/JavaFX desktop application that has been running successfully on a Windows platform (Server 2012) for almost a year.
Recently we moved the application to a different Windows platform (Server 2019, virtual machine).
The app is installed on a shared drive and is started several times a day. It initially runs successfully but at some point in the day will no longer start.
The command line is:
java -p WolfToolkit.jar;WolfToolkit_mods -m com.mycompany.wolftoolkit/com.mycompany.start.StartGUI
WolfToolkit_mods is a folder containing jars for the required modules. When the start-up error occurs, Java.exe reports thatvarying required modules cannot be found. After a lot of diagnostic testing, it appears that Java.exe can no longer detect any of the jar files in the WolfToolkit_mods folder even though Windows Explorer shows the correct content.
If I copy folder WolfToolkit_mods to WolfToolkit_mods2 and change the command to
java -p WolfToolkit.jar;WolfToolkit_mods2...
then the app starts correctly.
If I re-copy just one of the jar files into WolfToolkit_mods and use the original command, then only that file is visible. If all files are re-copied then the app runs correctly.
So, the behaviour is as if Java suddenly views WolfToolkit_mods as being empty and only detects each jar file when it is copied back in. Meanwhile Windows sees no problems. I should also mention that on rare occasions Java.exe suddenly starts reporting that WolfToolkit.jar is "Module format not recognized". Again, re-copying the file resolves the issue.
Any ideas on what this could be or how to diagnose? Thanks.
Windows Server 2019 Standard v10.0
JVM: OpenJDK 64-bit Server v11.0.10+9
This looks to have been caused by the virus checker which was quarantining all .jar files as "suspicious". Presumably when java.exe was trying to read the files on the module path the virus checking software intervened and the effect was that java.exe couldn't locate module-info and so reported missing modules.
Thanks to those who took the time to respond.
I cannot get Apache Tomcat to start. I followed the instructions for installing Tomcat on the Mac found at https://www.dev2qa.com/how-to-install-tomcat-in-macos/.
After I type the command to start Tomcat, the response from the command line is that Tomcat has started.
However, when I go to the browser, the default page is not showing up. I further checked to see if the port was being used by using the command
lsof -nP -i4TCP:8080 | grep LISTEN
which showed that no program is using the port. I also read the 'RUNNING.txt' that instructed me on setting the environmental variables, which I did. Any suggestions on why Tomcat is not starting up.
I'm using jdk 1.8.0_202 and Apache Tomcat 9.0.14 that is running of Mac OS High Sierra.
BatChmod
After downloading a fresh version of Tomcat, I use the BatChmod app to alter the file permissions. Tomcat will not launch properly without altering the permissions.
I do not know the command-line equivalent, but here is a screenshot of the settings I have used for years successfully.
Plea for help
If anyone can write the equivalent as a shell script for macOS, please post!
Even better, explain how to wrap such a script as an AppleScript for drag-and-drop execution in Finder.
The problem turned out to be a permissions problem. When I installed Tomcat, I put the folder in the '/Library/Tomcat' directory. Even though the Tomcat files were changed to be executable, the user and group ownership remained the same. To get Tomcat to run, I moved the directory to 'Users/MyUserName/Tomcat'. Once I did that, the default Tomcat page ran.
I'm trying to install JDK 7 on a Windows 7 machine and constantly getting the error "A semi-colon found in selected path" no matter what path I select for the installation.
Tried with different updates of JDK and it didn't help either.
EDIT: Installation log shows the following error:
Thu May 05 06:34:19 2016
:: JDK installation failed. Return Code: 1603, ErrorCode: 0
This error message is displayed by the Microsoft Windows Installer engine and is a general error code that indicates a problem occurred during the installation.
Read on to learn how to sidestep this speed bump.
The following is a non-exhaustive list of known causes for this error:
Short file name creation is disabled on the target machine.
An Install Script custom action is prototyped incorrectly.
A file is locked and cannot be overwritten.
The Microsoft Windows Installer Service is not installed correctly.
The Windows Temp folders are full.
The setup was corrupted after installation and, therefore, fails with this error during un-installation.
An older version of Install Shield Developer is being used.
A general error occurred during the installation.
Print and File sharing is not installed or enabled when installing MSDE 2000.
How to Avoid this Error
The following solutions have resolved this error in the majority of cases:
Make sure short file name creation is enabled on the target machine. You can check to ensure that the target machine does not have short file name creation disabled by navigating to the following registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
Make sure the value "NtfsDisable8dot3NameCreation" is equal to 0. This indicates that short file name creation is enabled. A value of 1 indicates that this functionality is disabled. You should change the value to 0.
After modifying this value, the target machine should be rebooted before attempting to launch the setup again.
Note: If the target machine should normally have short file name creation disabled, it can be disabled after the install completes by resetting "NtfsDisable8dot3NameCreation" to 1 and rebooting.
To ensure that the Windows Installer Service is properly installed and configured, it is recommended that users install the file InstmsiA.exe on Windows 95/98/Me or InstmsiW.exe on Win NT systems. These files are shipped with your InstallShield product and are located in the following location:
<Product Path>\Redist\Language Independent\i386
Empty all temporary folders. The specific temporary folders for a machine can be determined by accessing the DOS prompt and typing set. Note the values listed for TEMP and TMP, and delete all files in those locations.
Make sure no other applications, including utilities such as virus scanners, are running in the background. Close all running applications and utilities, and launch the installation again.
If this error occurs during un-installation, use the Microsoft Windows Installer CleanUp utility to uninstall the installation.
Once the installation has been successfully un-installed, you can then debug the project to determine what caused the original error.
Put your installer executable to C:\ and run it from there.
More info here: http://wills-tech-notes.blogspot.com/2015/12/cannot-install-java-semicolon-found-in.html
The Error which you are getting is normally it throws during java update installation, Not, the first time installation.
Please kindly follow the below steps to resolve your issues. Let's give a try.
Step 1:
Just want to ensure if you have already java installed on your machine partially.
Follow the below entries in command prompt:
java -version - If it throws error we are good.
echo %JAVA_HOME% and echo %JRE_HOME%
echo %PATH% - If you see the Java entries you may need to clear all this.
echo %CLASSPATH% - Here as well as said in above.
If no results from the Step 1, Please follow Step 2.
Step 2:
Check your C: drive for to verify there should not any Java installation folders. If yes, Please delete those.
Clear all your logs from your machine(If it contains any existing java related logs)
https://www.java.com/en/download/help/plugin_cache.xml
Step 3:
Actually, we do not require to install the Java, instead we can download the Zipped java file and locate into dedicated drive.
And then, make all your environment variables entries into this location. In, this case you are good i believe.
If you still face issues, do let me know?
Try this and maybe you'll get your job done
1 Close the installer when you see Java error 1603. (It has installed a
bunch of files, but exits prematurely.)
2 Open javacpl.exe from C:\Program Files (x86)\Java\jre1.8.0_XX\bin (or
for x64, C:\Program Files\Java\jre1.8.0_XX\bin) where XX is the update
number.
3 Uncheck "Enable Java content in the browser" on security tab and click
OK to close Java control panel
4 Retry installing Java. It usually succeeds for this time.
5 Open javacpl.exe again (see step #2)
6 Check Enable Java content in browser on security tab and click OK to
close Java control panel
7 If it still fails, try uninstalling windows update KB2918614, then
reboot and try these steps again.
Try following steps:
Run installer from c:/
Run jdk*...*.exe /log msi.log to see installation logs, please attach
them if it won't help you understand a cause of the problem
In the related JDK bug an issue with an environment was a cause of the problem.
uninstall KB3139923 helped in my case
I had the same problem with version 8 and the solution was to run the installer as Administrator (right click, then "Run as Administrator").
I would like to monitor a local Java application using JVisualVM. When I'm starting it, the popup 'Local java application cannot be monitored' or 'Local Applications Cannot Be Detected' is shown. I have read here that it is a permissions problem. Every time when I grant full access to folder %TMP%hsperfdata_MY_USER_ID to me (logged user) and everyone (windows user), the permissions are reset when I start JVisualVM.
I know that another solution is to delete hsperfdata_MY_USER_ID, but why does the permissions trick not work? Is the permissions folder reset a Windows feature?
System : Windows 7
Tested on cmd started as administrator. I use the same accounts and I do not pass any JVM parameters such as com.sun.management.jmxremote.port=XXXX.
For people stumbling here who have a FAT-type file system:
Make a directory (e.g. e:\temp) on an NTFS disk.
Start both java and jvisualvm with an environment variable TMP=E:\temp.
There are three options to set the environment variable for java:
In your IDE, go to the project options or launch options and find the 'Environment' entry, then enter TMP=E:\temp
Open a cmd prompt, and execute set TMP=E:\temp before launching youur java application from the same prompt.
Put the two lines you'd enter at the cmd prompt in a .bat file. Optinally add pause at the end of the bat file to prevent the console window from disappearing in case of a runtime exception or vm crash.
Similarly, for JVisualVM, use one of the last two options.
I had the 'Local Applications Cannot Be Monitored' problem, got it solved like this:
Exit all java processes
Delete existing folder %TMP%\hsperfdata_username
Start jvisualvm, which created the folder with a different casing: %TMP%\hsperfdata_USERNAME
My problem and solution have nothing to do with permissions, so may not work for the original problem in the question.
Also see https://visualvm.github.io/troubleshooting.html#jpswin
This answer is a bit trivial but might still save time.
Check your java application is not lauched with the "-XX:-UsePerfData" option.
My username: A4000000
I had to delete C:\Users\A4000000\AppData\Local\Temp\hsperfdata_a4000000
AppData is a hidden folder.
Then once starting VisualVM again, it created the following:
C:\Users\A4000000\AppData\Local\Temp\hsperfdata_A4000000
Notice the case difference.
Then start:
C:\visualvm_213\bin> visualvm.exe --jdkhome "C:\Program Files\Java\jdk1.8.0_202" --userdir "C:\Temp\visualvm_userdir"
I'm using netbeans 6.1.
I've got the following in my java run time settings:
-agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n
and the following in the attach dialog in netbeans:
Debugger: JPDA Debugger
Connector: Shared Memory Attach (Attaches by shared memory to other VMs)
Transport: dt_shmem
Name: jdbconn
I got the above settings from the FaqDebuggingAppletRemotely page on the netbeans Wiki.
The applet is in an aspx page (the applet, whcih is signed, is a method of communicating via the client browser to a legacy platform, I'm a C# developer really). I've managed to get the security warning to display which gives me a chance to attach to the applet but whenever I try to attach I see:
Attaching to jdbconn
shmemBase_attach failed: The system cannot find the file specified
in the output window in netbeans.
Any help gratefully received!
I would bet anything (almost anything ... maybe a few dollars at least, or a cookie) that the JVM installation your applets are running on is NOT the same as the default JVM installation that is installed on your system.
To find the JVM installation that your browser and applets are using in Windows 7:
1) Close all applications that use the JVM (especially the browser).
2) Open the windows task manager (CTRL+ALT+DELETE->Task Manager), and click on the processes tab.
3) Make sure there are not any java*.exe processes running.
4) Open your browser and go to the applets page, and start the applet up again.
5) Now go back to the Task Manager->Processes tab and look for the java*.exe that is now running (it will most likely be "java.exe *32" literally, as in it will literally have an asteriks in the name of the process. If you don't see that one, then just use whichever one IS running).
6) Right click on that process, and in the context menu select "Open File Location". This should bring you to the "bin" folder location of the installed JVM that your browser is using to run your applets! Are you surprised that it is not the same as what you thought it would be?
To find the task on linux or other systems:
I've only ever had this problem on Windows, but here's how you do it anyhow.
Open a shell, and type the following
ps -e | grep java
And make a note of the pid(s).
Now that you know which JVM your applets are using:
We need to open the Java Console for that partivular installation (as opposed to the default installation we tried to modify before).
To open the Console of the JVM installation that your applets are using, and set the runtime parameters:
1)Open a command prompt (shell or whatever) in the bin folder of the JVM installation. (In windows 7, from the explorer, you can shift+right-click on the bin folder, and select "Open Command Prompt Here").
2) Run the following command to open the console:
javaws -viewer
This also ends up opening the "Java Cache Viewer" window, which we do not need. Close that window, but keep the "Java Control Panel" window open.
3) You can now go to the Java tab, click on view, and modify the runtime parameters just as you did before:
-agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n
4) Click "OK", and then click "Apply" in the main java console window to apply and save all the changes you made.
5) WAIT! There is one last thing that I suggest you do; clear out the java WebStart cache to make sure your applets download fresh using the new parameters:
javaws -uninstall
Be sure and run this in the bin directory of the JVM installation that your applets are using, since this might not be the same bin directory that is pointed to by your Path (or PATH) system environment variable.
Now start up your applet from your browser, and create another shared memory connection inside your NetBeans IDE! Setup break points in the correct source code you are debugging ("source" tab in NetBeans), and start using your applet. You should now see that Netbeans is breaking on your break points!
At least, I hope so...
When you debug with the shared memory option (transport=dt_shmem), you're using Windows internal shared memory objects to communicate between the debugger and the jvm.
This means that if you're:
a. Not debugging from the same physical machine as your jvm, or
b. Not working on a Windows OS,
You can not debug in this mode.
I'm not sure what would happen if you ran a Window on a VM on a Linux station...Might work and might not.
If both of the above are fine, it would require a deeper investigation to find out the problem, but in the mean time, you could attach with a plain socket.
In the Java run time parameters specify:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=y
This tells your jvm to run in debug mode, load the jdwp library, wait for connection to attach in port 8000, and suspend execution until such a connection arrives.
In your IDE set the remote debugger accordingly. I don't know Netbeans, but it would be something like Connector = socket connector, address=8000.
When you start your web page, the applet will freeze loading until you connect, and of course you can't connect until it has reached the listening stage.
Good luck!