-1

I have the Android SDK witch include eclipse. Its working for developing android apps, but now I want to make a tool app for pc and I need some of the java standard libraries that where not included with the Android sdk, for example javax.imageio.imageio.

Where can I get these libraries ?

I know there is a src.zip file with all the source code from java standard libraries in the Java directory, but Is there not a jar file or something like that so i can just include it as an external library ?

user5819
  • 534
  • 4
  • 11
  • 2
    [Download the JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html), and [install it in Eclipse](http://stackoverflow.com/a/998643/571407). – JB Nizet Feb 21 '15 at 16:33
  • That did not work... – user5819 Feb 21 '15 at 18:53
  • Ah, the famous "did not work" problem. This is easily fix by applying the solution "then try again". – JB Nizet Feb 21 '15 at 18:56
  • Ok, thanks. But It still don't work, I think I better make a library out of the java source code from src.zip – user5819 Feb 21 '15 at 19:03
  • My above comment was a way to make you realize that "it doesn't work" doesn't mean anything. We can't help you with such a vague description of the problem. We don't have any idea of what you actually did, and of what the problem is. Likewise, if you told us **what** it says, instead of saying "it still says the same thing", we could perhaps help. – JB Nizet Feb 21 '15 at 19:07
  • Sorry, It says "ImageIO cannot be resolved to a type" – user5819 Feb 21 '15 at 19:13
  • Have you configured your project to use the newly installed JDK? Have you imported javax.imageio.ImageIO in your class? – JB Nizet Feb 21 '15 at 19:14
  • Now I have a new error on the import javax.imageio.imageio that says "Access restriction: The type ImageIO is not accessible due to restriction on required library B:\Java\lib\rt.jar" – user5819 Feb 21 '15 at 19:26
  • It seems you have created an Android project. Not a regular Java project. – JB Nizet Feb 21 '15 at 19:28
  • I am sure I have created a Java project – user5819 Feb 21 '15 at 19:40
  • I think the problem is that I use the android eclipse that leak some libraries, but I can still make Java projects – user5819 Feb 21 '15 at 19:41

2 Answers2

0

This worked for me !

  1. Go to the Build Path settings in the project properties.
  2. Remove the JRE System Library
  3. Add it back; Select "Add Library" and select the JRE System Library.

Found this solution here.

Community
  • 1
  • 1
user5819
  • 534
  • 4
  • 11
-1

You should edit your build.gradle file. There is a dependency section in there.

djangofan
  • 28,471
  • 61
  • 196
  • 289