Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove note in log : Got stderr: Picked up _JAVA_OPTIONS: -Djava.awt.headless=true #347

Closed
3 of 7 tasks
SundareshSankaran opened this issue Apr 10, 2023 · 1 comment

Comments

@SundareshSankaran
Copy link

Summary of your issue

I call the tabula-py package from within a non-standard IDE (SAS Studio), which has the ability to submit Python commands.

I get the following note, which seems benign (I am able to obtain correct output).

Got stderr: Picked up _JAVA_OPTIONS: -Djava.awt.headless=true

However, I would like to remove the same. I changed my command to the following but that didn't work.

table = tabula.read_pdf(file1,pages=1, java_options="-Djava.awt.headless=True" )

Check list before submit

Python version:
    3.10.4 (main, Apr  4 2023, 16:10:58) [GCC 8.5.0 20210514 (Red Hat 8.5.0-16)]
Java version:
    Picked up _JAVA_OPTIONS: -Djava.awt.headless=true
openjdk version "11.0.18" 2023-01-17 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.18.0.10-2.el8_7) (build 11.0.18+10-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.18.0.10-2.el8_7) (build 11.0.18+10-LTS, mixed mode, sharing)
tabula-py version: 2.7.0
platform: Linux-5.4.0-1103-azure-x86_64-with-glibc2.28
uname:
    uname_result(system='Linux', node='sas-compute-server-7274a925-7a47-4bef-9d1e-0c9397ade394-9936', release='5.4.0-1103-azure', 
version='#109~18.04.1-Ubuntu SMP Wed Jan 25 20:53:00 UTC 2023', machine='x86_64')
linux_distribution: ('Red Hat Enterprise Linux', '8.7', 'Ootpa')
mac_ver: ('', ('', '', ''), '')
None

If not possible to execute tabula.environment_info(), please answer following questions manually.

  • Paste the output of python --version command on your terminal: ?
  • Paste the output of java -version command on your terminal: ?
  • Does java -h command work well?; Ensure your java command is included in PATH
  • Write your OS and it's version: ?

What did you do when you faced the problem?

Code:

table = tabula.read_pdf(file1,pages=1)

Expected behavior:

(No note; command executes successfully)

Actual behavior:

Got stderr: Picked up _JAVA_OPTIONS: -Djava.awt.headless=true

Related Issues:

@chezou
Copy link
Owner

chezou commented Apr 10, 2023

While tabula-py enforcing setting -Djava.awt.headless=true option for Darwin, it should not set on Linux.

tabula-py/tabula/io.py

Lines 408 to 410 in b24e3bd

if platform.system() == "Darwin":
if not any("java.awt.headless" in opt for opt in java_options):
java_options += ["-Djava.awt.headless=true"]

Looking at your output of tabula.environment_info(), there is same message for "Java version":

Java version:
    Picked up _JAVA_OPTIONS: -Djava.awt.headless=true

However, java_version() calls java command without adding any option. It presumably your environment issue.

tabula-py/tabula/util.py

Lines 28 to 30 in b24e3bd

res = subprocess.check_output(
["java", "-version"], stderr=subprocess.STDOUT
).decode()

If you just want to suppress Got stderr: Picked up _JAVA_OPTIONS: -Djava.awt.headless=true, you can change log level like:

logging.getLogger("tabula").setLevel(logging.ERROR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants