Problem with importing certain files

23 views
Skip to first unread message

diar...@neuf.fr

unread,
Mar 23, 2014, 9:50:30 AM3/23/14
to codenameone...@googlegroups.com
Hi there,

I'm currently working on a codename one project in eclipse that will use file IO for a mock up account and password system, just using a simple text file to start with. My problem is that the project doesn't recognize the following imports: java.io.BufferedReader, java.io.File, java.io.FileReader, java.io.FileWriter and java.io.BufferedWriter. It is happy with import java.io.IOException. (I said this was a problem with the project because I did just a simple java project and imported the same thing and there was no problem)

What is stranger is that I then added the JRE system library to my project, which took away the error markers in the code writing area, however the errors were still showing in the compiler, BUT the program now runs with what I wanted and changes fine despite each time I compile it it says build failed. This would be fine if I wanted to just use it on my computer but I need to build it on the server and it won't send to the server unless it can successfully build.

Why does the project not recognize those imports (that have been in java since 1.1), and why does the project say the build has failed, but actually compiles anyway? And does anyone have an idea on how I might fix this?

Thanks in advance for the help,

Shai Almog

unread,
Mar 23, 2014, 3:01:36 PM3/23/14
to codenameone...@googlegroups.com, diar...@neuf.fr
Hi,
we don't support the full Java SE for a reason. Phones don't have a file system in the way that PC's/Macs have a file system and so we have a special API designed to work across phones.
DO NOT change the classpath, it will obviously not work on the devices and we designed the classpath in a way that will prevent you from doing something like that.

If you need to work with files please read the developer guide sections covering FileSystemStorage & Storage: http://www.codenameone.com/developer-guide.html
You can also refer to the javadoc: https://codenameone.googlecode.com/svn/trunk/CodenameOne/javadoc/index.html

diar...@neuf.fr

unread,
Mar 24, 2014, 6:54:44 AM3/24/14
to codenameone...@googlegroups.com, diar...@neuf.fr
Ok thanks very much for your help :-)
Reply all
Reply to author
Forward
0 new messages