Try this.
InputStream is = getClass().getClassLoader()
.getResourceAsStream("/words.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(is));
More Related Contents:
- How to add native library to “java.library.path” with Eclipse launch (instead of overriding it)
- How to locate the Path of the current project directory in Java (IDE)?
- How do relative file paths work in Eclipse?
- Setting up Eclipse with JRE Path
- Setting the correct PATH for Eclipse
- Program that asks user how many times it wants to loop for (java)
- Differences of components missing from OpenJDK-17 (Eclipse Temurin) which was present in OracleJDK-11 [closed]
- Eclipse/Java code completion not working
- Hidden features of Eclipse [closed]
- NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder
- Class JavaLaunchHelper is implemented in both … libinstrument.dylib. One of the two will be used. Which one is undefined
- Environment variables in Eclipse
- Eclipse: Attach source/javadoc to a library via a local property
- Easy way of running the same junit test over and over?
- Selenium Webdriver + Java – Eclipse: java.lang.NoClassDefFoundError
- No tests found with test runner ‘JUnit 4’
- Things possible in IntelliJ that aren’t possible in Eclipse?
- Finding unused jars used in an eclipse project
- javac1.8 class not found
- Online radio streaming app for Android
- Android drawable speech bubble
- How to get carriage return without line feed effect in Eclipse console?
- Spring Boot Program cannot find main class
- How can Eclipse create a class with unresolved compilation problems?
- Determine if a java application is in debug mode in Eclipse
- NoClassDefFoundError on external library project for Android
- ClassNotFoundException DispatcherServlet when launching Tomcat (Maven dependencies not copied to wtpwebapps)
- Can the Eclipse Java formatter be used stand-alone
- Libraries for pretty charts in SWT? [closed]
- Create executable Jar file under Eclipse