Ask coding questions

← Back to all posts
Packages and .class files in Repl.it
asammoud (3)

Hello all,
I have some .class files that are part of a package that I would like to use in my Java code on repl.it. How can I add .class files into repl and use them in my code.
P.S:
I tried to recreate the directory tree for my package in repl but the Java compiler seem to have issues with my .class location.
Error Message:
bad class file: ./package_create/Pack.class
class file has wrong version 54.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error

Comments
hotnewtop
pyelias (2641)

repl.it's Java version is a bit out of date. It is using Java 8, and you compiled your code with Java 10.You could use -target 8 to compile to the correct version.

(dont actually use java much, I might be wrong)