The thing is, I am looking for a codeline which can import a txt file which is in the same folder as the .jar. The only problem is, the path where the jar and the txt file will be is unknown. So I am searching for a method which can return me the path of the .jar file which is at the same time the path of the txt. But it has to work with an outstanding .jar file and not only in console. Would appreciate some helpful answers because I tried so many not working ways until now.
Asked
Active
Viewed 13 times
0
-
1What's the structure of the JAR? In other words, where is the .class file that reads the text file located in the JAR? I'm assuming that the text file is located outside of the JAR. – Gilbert Le Blanc Dec 17 '20 at 12:48
-
@gilbert why is that relevant? – Thorbjørn Ravn Andersen Dec 17 '20 at 13:16
-
Because I need to see the JAR directory tree to get the proper amount of */..* to add to the file path of the text file. – Gilbert Le Blanc Dec 17 '20 at 14:20