So, I'm new to Java, and I was looking at how to use a class from a Jar file. I created a java file with all the classes I wanted and then got a Jar file from it, I imported it using this interface but now how can I actually use it? I'm not using Maven or anything. Just plain java project from VSCode (Java Extension Pack and Jar Builder installed).
I know that maybe I should use a different program but I really like VSCode so If u could help here I would appreciate it :)
Here is the java file that I built the Jar from
import java.io.*;
public class Ler {
public static String umaString (){
String s = "";
try{
BufferedReader in = new BufferedReader ( new InputStreamReader (System.in));
s= in.readLine();
}
catch (IOException e){
System.out.println("Erro ao ler fluxo de entrada.");
}
return s;
}
public static int umInt(){
while(true){
try{
return Integer.valueOf(umaString().trim()).intValue();
}
catch(Exception e){
System.out.println("Não é um inteiro válido!!!");
}
}
}
public static char umChar(){
while(true){
try{
return umaString().charAt(0);
}
catch(Exception e){
System.out.println("Não é um char válido!!!");
}
}
}
public static short umShort(){
while(true){
try{
return Short.valueOf(umaString().trim()).shortValue();
}
catch(Exception e){
System.out.println("Não é um short válido!!!");
}
}
}
}