PGPROF not finding Java

Dear support.
I might be a known issue but when I try to pgprof the pgprof.out file, I get the following error message:

pgprof.exe pgprof.out
gprof-Error-Unable to execute Java command ‘C:\Program Files\Java\jre1.8.0_73\bin\java.exe’ - set PGI_JAVA or use -text

I’ve tried, as recommended in the User’s Guide, to set the PGI_JAVA environmental variable without any success. However, the output of where java gives me

$ where java
C:\Program Files\Java\jre1.8.0_73\bin\java.exe
C:\Program Files\Java\jdk1.8.0_60\bin\java.exe
C:\ProgramData\Oracle\Java\javapath\java.exe

Any suggestions to proceed further ? Thank you very much for your answer.
Best regards
Roland
[/quote]

Hi Roland,

Under which shell are you invoking pgprof and what directories are in your PATH?

In the pgi.bat file (the PGI Cygwin bash shell) we set the PATH to include the java directory. I’m wondering if you’re invoking pgprof from a Cygwin shell without this PATH set.

  • Mat

Dear Mat,
under PGI Cygwin bash shell. However the PATH seems to be set as part of
echo $PATH returns
/cygdrive/c/Program Files/Java/jre1.8.0_73/bin:
/cygdrive/c/Program Files/Microsoft HPC Pack 2012/Bin:
/cygdrive/c/Program Files/Java/jdk1.8.0_60/bin:
/cygdrive/c/ProgramData/Oracle/Java/javapath:

Do I have to do something more ?
Best regards
Roland

Have you changed the Cygwin mount drive? Maybe this is a red-herring, but I would expect your PATHs to be “/c/” not “/cygdrive/c/”. The default CYGWIN will usually use “/cygdrive/c/” but the one we ship is configured to use “/c/”. I’ve forgotten how to change the mount but will see if I can try and recreate this here to see if it’s the problem.

Can you try invoking pgprof from the PGI DOS command shell instead?

  • Mat

Dear Mat,
Thank you for your answer. From the PGI DOS command shell I have the same issue:

pgprof pgprof.out
pgprof-Error-Unable to execute Java command ‘C:\Program Files\Java\jre1.8.0_73\b
in\java.exe’ - set PGI_JAVA or use -text

and echo %PATH%
C:\ProgramFiles\Java\jdk1.8.0_60\bin
C:\ProgramData\Oracle\Java\javapath
C:\Program Files\Java\jre1.8.0_73\bin

Any suggestions maybe ?
Thank you
Roland Guichard

I had the same problem. Re-installing PGI workstation fixed the issue but I don’t know where it came from initially.

Cheers,

Mark

Could it be that the PGI installation isn’t complete ? For instance it couldn’t find the jpgdbg.jar file. I suspect that I miss some .jar files to link with Java.
Best regards
Roland

Possible. I don’t think it aborts if the Java packages fail.

Does reinstalling as Mark suggest fix the issue?

Dear Mat,
No, not for me. I’ve been through the process twice without success. It seems that the installation has gone through but there are some missing files. Is there a procedure to check upon this maybe ?
Thank you
Roland

I’ve encounter errors like this on Windows when the java included in my path variable is a symlink rather than the actual java executable. I would suggest that you run PGPROF with only the actual java.exe file in your path.