Linked Questions

2 votes
3 answers
10k views

I have a Java application that I build with Maven. I have a resources folder com/pkg/resources/... that I need to access files from. For example directory.txt. I've been looking at various tutorials ...
SVN600's user avatar
  • 385
1 vote
2 answers
12k views

My goal is to create an executable jar from Eclipse. I have an Eclipse project which runs fine with the structure below. My Eclipse project src/main/java -com.main ->MyClass src/main/...
Senthil RS's user avatar
2 votes
1 answer
3k views

In the project resource files, I have a default image default_image.png. I need to go to him and translate it into an array of bytes. Image image = new Image("/icons/default_image.png"); URL ...
A1ex NS's user avatar
  • 57
0 votes
2 answers
4k views

How can I get a file of a jar (inside a maven dependency) with getResourceAsStream method? I tried following which returned null: InputStream is = App.class.getResourceAsStream("jquery.js");
gartenkralle's user avatar
2 votes
1 answer
3k views

I am using maven web application. The following is my project structure where I have placed my properties file. The following is my code which I am using to read this file: public static Properties ...
Salman Shaikh's user avatar
1 vote
1 answer
3k views

Working with Jaspersoft Studio I notice that it allows you to generate a JAR file with all your fonts and XML files with each font variation definition. Its great for portability reasons, but Im not ...
Andres Sandoval's user avatar
0 votes
2 answers
3k views

I have a project where I like to read data from json files. However, the files cannot be found. I have already tried the java directory, as well as src/main/resources. For reading the files I use: ...
Cord's user avatar
  • 45
3 votes
1 answer
2k views

I've read a bunch of similar posts, but i can't find a solution for my problem: i need to validate and parse xml files. (validation against xsd schema). The problem is that on my approach, when i run: ...
laura's user avatar
  • 2,133
0 votes
1 answer
3k views

I am trying to read values from a json file which I have placed in my resource folder directly. I am able to run it successfully without any error in bootrun & also build successfully within ...
PotatoGod's user avatar
0 votes
2 answers
1k views

My code use getClass().getResource() to get the file location but when I create the jar file it can't find my file even I copy the to jar file directory. And the log give me a weird path Server2018....
BAXMAY's user avatar
  • 63
0 votes
1 answer
1k views

In my project I access the folder that is in /src/main/ressources/Mylib in eclipse it works well without any problem, but when i export the project into .jar file it does not work. The line of code ...
Afatsum's user avatar
  • 137
-2 votes
1 answer
1k views

This is not a duplicate, because Media objects cannot be initialized with getResourceAsStream(). From the docs: "only HTTP, FILE, and JAR URIs are supported." My JavaFX project works perfectly when ...
wolfy's user avatar
  • 113
0 votes
1 answer
752 views

I am trying to access High_Scores.txt file stored in folder Resources. My project tree looks like this: I am using the code shown below to access the file. Checked this similar question but the ...
Mohsin Anees's user avatar
0 votes
3 answers
237 views

I am currently working on a project where I need to read an image but it doesn't work currently. As long as I run it in IntelliJ everything is fine, but as soon as I export the project into a jar I ...
Felix Dobler's user avatar
0 votes
1 answer
234 views

I need to access to a xsd file that it's inside my jar. My problem is that my classpath is C:\Users\fabio\Documents. My jar file it's in that path too , so how can I get the file that I need? I tried ...
Fabio's user avatar
  • 393

15 30 50 per page
1
2 3 4 5
10