# Java QuestionCompiling error with SLC

#### Johan Schoeman

##### Expert
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:

#### Johan Schoeman

##### Expert
I think SLC picks up the android.jar path from the B4A IDE path.
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?

#### Erel

Staff member
Is B4A installed on that computer?

#### JTmartins

##### Active Member
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

#### Johan Schoeman

##### Expert
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
OK Jose - now you are in good hands!

#### Erel

Staff member
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?

#### JTmartins

##### Active Member
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.
[-docletpath, C:\Program Files (x86)\Anywhere Software\SimpleLibraryCompiler]
[-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:

#### JTmartins

##### Active Member
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) ***

#### Johan Schoeman

##### Expert
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) ***
Jose, you need to put com in the -b4aignore field. Not xxx. It should then compile!

Replies
2
Views
152
Replies
2
Views
405
Android Question SLC compiler with java 11
Replies
1
Views
260
Replies
1
Views
254
Replies
13
Views
2K