Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

581
Views
Getting an Apache error when using php's shell_exec() to call a java program?

I am trying to run a java program called 'Audiveris' with php's shell_exec() function. Audiveris is an open source tool for optical music recognition written in java. I am able to call and run small test java files that output a simple string with shell_exec(). However, when I try to call Audiveris I get an error in the Apache Error log. Here is the error message I am getting.

May 01, 2020 8:21:04 PM sun.awt.shell.Win32ShellFolderManager2 getPersonal
WARNING: Cannot access 'Personal'
java.io.IOException: Could not get shell folder ID list
    at sun.awt.shell.Win32ShellFolder2.getFileSystemPath0(Native Method)
    at sun.awt.shell.Win32ShellFolder2.access$800(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2$7.call(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2$7.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

May 01, 2020 8:21:04 PM sun.awt.shell.Win32ShellFolderManager2 getDesktop
WARNING: Cannot access 'Desktop'
java.io.IOException: Could not get shell folder ID list
    at sun.awt.shell.Win32ShellFolder2.getFileSystemPath0(Native Method)
    at sun.awt.shell.Win32ShellFolder2.access$800(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2$7.call(Unknown Source)
    at sun.awt.shell.Win32ShellFolder2$7.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.audiveris.omr.Main.<clinit>(Main.java:64)
    at Audiveris.main(Audiveris.java:49)
Caused by: java.lang.NullPointerException
    at org.audiveris.omr.WellKnowns.getFolderForWindows(WellKnowns.java:403)
    at org.audiveris.omr.WellKnowns.getFolder(WellKnowns.java:302)
    at org.audiveris.omr.WellKnowns.<clinit>(WellKnowns.java:141)
    ... 2 more

Here is what I am using in shell_exec. All paths are correct and $sheet_music_path is simply the path to the sheet music pdf. I got this command from Audiveris' gitbooks and I am able to use this command in command prompt with no issues.

shell_exec('java -cp "Audiveris/lib/*" Audiveris -batch -export '.$sheet_music_path);

I am using Windows 10, jdk8 (required by Audiveris), php 7.3.12, apache 2.4.41 and a Wamp server. Thanks.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!