Java Question Compiling error with SLC

Discussion in 'Libraries developers questions' started by Johan Schoeman, Jan 27, 2015.

  1. Johan Schoeman

    Johan Schoeman Expert Licensed User

    A B4A member is trying to compile the java source code that I have posted here with SLC but gets an error. He also tried an earlier post and it gives the same error.

    Starting step: Compiling Java code.
    javac 1.8.0_25
    D:\BlueDudeZxingLib\src\ice\zxing\b4aZXingLib.java:4: error: package android.content does not exist
    import android.content.Intent;

    The first 4 lines of b4aZXingLib.java is as follows:

    line 1. package ice.zxing;
    line 2.
    line 3. import java.io.UnsupportedEncodingException;
    line 4. import android.content.Intent;

    It compiles without any problem on my computer. Any idea what is the reason for the compiling error that he gets?
     
    Last edited: Jan 27, 2015
  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    I think SLC picks up the android.jar path from the B4A IDE path.
     
  3. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Thanks @thedesolatesoul. I am travelling at present and cannot help him to solve this right now. What is the solution? Is there a path in his B4A IDE that needs to be set up or is not corrrectly set up?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Is B4A installed on that computer?
     
    thedesolatesoul likes this.
  5. JTmartins

    JTmartins Active Member Licensed User

    Yes it is Erel. And working perfectly. The path in B4A is C:\androidSDK\platforms\android-17\android.jar and B4A is installed in the usual place C:\Program Files (x86)\Anywhere Software\Basic4android
     
  6. Johan Schoeman

    Johan Schoeman Expert Licensed User

    OK Jose - now you are in good hands!
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Actually I'm not sure why it fails to compile. Is this the full error message?

    Are you able to compile the FirstLibrary example that is in SLC zip file?
     
  8. JTmartins

    JTmartins Active Member Licensed User

    Yes I Can. Compiling firstlib and (after setting the proper permissions in anywhere software folder) it compiles OK..But Firstlib.xml does not apear in extra-libs folder

    Starting step: Compiling Java code.
    Completed successfully.
    Starting step: Creating jar file.
    Completed successfully.
    Starting step: Creating XML file.
    Loading source file D:\SLCTEST\FirstLibrary\src\com\example\FirstLib.java...
    Constructing Javadoc information...
    [-doclet, BADoclet]
    [-docletpath, C:\Program Files (x86)\Anywhere Software\SimpleLibraryCompiler]
    [-doclet, BADoclet]
    [-docletpath, C:\Program Files (x86)\Anywhere Software\SimpleLibraryCompiler]
    [-classpath, C:\Program Files (x86)\Anywhere Software\B4J\B4J.exe\../libraries\jFX.jar;C:\Program Files (x86)\Anywhere Software\B4J\B4J.exe\../libraries\jCore.jar;C:\Program Files (x86)\Java\jdk1.8.0_25\bin\..\jre\lib\jfxrt.jar;]
    [-sourcepath, src]
    [-b4atarget, C:\Program Files (x86)\Anywhere Software\B4J\extras-lib\Firstlib.xml]
    starting....
    Working with class: com.example.FirstLib
    finish: C:\Program Files (x86)\Anywhere Software\B4J\extras-lib\Firstlib.xml

    Completed successfully.
    *** Don't forget to refresh the libraries list in the IDE (right click and choose Refresh) ***


    Ah..ok. It went to B4J folder
     
    Last edited: Jan 27, 2015
  9. JTmartins

    JTmartins Active Member Licensed User

    Oppps..I think I found the problem. I was running the B4J version...Testing the other now. Silly me.

    Ok it compiles now. Although I get a bunch of No ShortName annotation found for class: XXX

    wich is the same problem I'm getting from Eclipse and that does not allow me to compile there...

    But it compile here, So I will test this now.

    Completed successfully.
    *** Don't forget to refresh the libraries list in the IDE (right click and choose Refresh) ***
     
  10. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Jose, you need to put com in the -b4aignore field. Not xxx. It should then compile!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice