defold / defold.github.io

www.defold.com
Other
11 stars 13 forks source link

Unable to locate a Java Runtime when running "python update.py --download codepad" #78

Closed mikatuo closed 8 months ago

mikatuo commented 10 months ago

Was following the README and got an error when running

python3 update.py --download docs codepad refdoc examples assets

The initial error:

The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

And after installing Java 8 getting a different error, so looks like Java 17 is required:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/dynamo/bob/Bob has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Logs:

Downloading https://github.com/defold/doc/archive/master.zip to ./doc-master.zip
Unpacking /var/folders/02/fj8dwp59007_d6m9cw6jy9mr0000gn/T/tmpaxpvm4kq/doc-master.zip
Processing docs
...languages
...index
...manuals (en)
...faq (en)
...manuals (zh)
...faq (zh)
...manuals (es)
...faq (es)
...manuals (gr)
...faq (gr)
...manuals (ko)
...faq (ko)
...manuals (pl)
...faq (pl)
...manuals (pt)
...faq (pt)
...manuals (ru)
...faq (ru)
...shared includes (en)
...shared includes (zh)
...shared includes (es)
...shared includes (gr)
...shared includes (ko)
...shared includes (pl)
...shared includes (pt)
...shared includes (ru)
...tutorials
...index (incl. languages)
...shared images
Done
Downloading https://github.com/defold/codepad/archive/master.zip to ./codepad-master.zip
Downloading http://d.defold.com/archive/e0073d0f7156b733e97a53c46924355fbf60dc77/bob/bob.jar to ./bob_e0073d0f7156b733e97a53c46924355fbf60dc77.jar
Unpacking /var/folders/02/fj8dwp59007_d6m9cw6jy9mr0000gn/T/tmp5ryqp6n8/codepad-master.zip
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

Traceback (most recent call last):
  File "/Users/mikatuo/dev/defold.github.io/update.py", line 1091, in <module>
    process_codepad(download = args.download)
  File "/Users/mikatuo/dev/defold.github.io/update.py", line 603, in process_codepad
    rmcopytree(os.path.join(input_dir, "build", "default", "DefoldCodePad"), codepad_dir)
  File "/Users/mikatuo/dev/defold.github.io/update.py", line 104, in rmcopytree
    shutil.copytree(src, dst)
  File "/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/shutil.py", line 559, in copytree
    with os.scandir(src) as itr:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/02/fj8dwp59007_d6m9cw6jy9mr0000gn/T/tmp5ryqp6n8/codepad-master/build/default/DefoldCodePad'

...

Downloading https://github.com/defold/examples/archive/master.zip to ./examples-master.zip
Processing examples
Unpacking /var/folders/02/fj8dwp59007_d6m9cw6jy9mr0000gn/T/tmp6vmldm59/examples-master.zip
..building app
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
britzl commented 10 months ago

Building the codepad and examples require bob.jar and a compatible JDK (17). Install links here: https://github.com/defold/defold/blob/dev/README_SETUP.md#required-software---java-jdk-17