including a class in a Java file in a project
已回答
I am probably putting this in the wrong place but I need some help. I apologize in advance if this is something easy, but I am not a java programmer or very conversant with IntelliJ
My daughters are doing a computer science class and using Replit for their java programming work. It is not always working/available, so I set them up with IntelliJ so they can do their programming locally on their laptops.
Their teacher gave them a custom .java resource file called In.java and they use it for inputting data from the keyboard by calling methods from In.
I see lots of references to using .jars as resources, but not using .java files. Where would I put the In.java file so they can call it in all their projects?
Thanks in advance
Bob
请先登录再写评论。
After compilation, .java file should be compiled into .class file and should be placed in target directory of your project.
Once it is compiled, just add .class file as a global dependency in Platform Settings > Global libraries: https://i.imgur.com/R509xdB.png
Once it is done, the classes from the file will be available in completion: https://i.imgur.com/3EB95R9.png