How to make my classes usable by others? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

How to make my classes usable by others?

so if i want to allow my classes to be used by others without them just having my source code what do i do? in eclipse i can chose export is exporting into a jar file what i want? or do i have to do something special?

21st Aug 2018, 5:48 PM
Robert Atkins
Robert Atkins - avatar
1 Answer
+ 4
You don't have to use jar files to allow other people to run your code AFAIK. You just have to share the folder with the .class files compiled from your source code and run the program from that folder (directory) with all the needed class files in it. If you want to share your program but don't want to share your source code then only share the .class files and not the .java files. The .java files are where your source code is saved that you compiled into .class files. Package hierarchy matters though, (The arrangement of the projects class files into different folders and subfolders.) so make sure to share the folder as is after compiled with all sub directories intact.
21st Aug 2018, 8:23 PM
Jason Brown
Jason Brown - avatar