Java Question Class file not found when testing library

MathiasM

Active Member
Licensed User
Hello

I'm trying to wrap a library for b4j. The library is JEP: https://github.com/ninia/jep
I searched for SLC on the forum and tried my luck (it's the first time I'm trying this)

What I did:
-Created a wrapperclass in Eclipse.
-Added the JEP.jar as external JAR
-Added jCore.Jar as external JAR

Here you can see the package contents and my (very basic) code:

OkvB1FM.png


SLC gives this as I press the compile button:

Starting step: Compiling Java code.
Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
Loading source file C:\Users\Mathias\eclipse-workspace\FirstLib\src\com\mathiasm\firstlib\FirstLib.java...
Constructing Javadoc information...
[-doclet, BADoclet]
[-docletpath, C:\Users\Mathias\Downloads\SimpleLibraryCompiler\SimpleLibraryCompiler]
[-doclet, BADoclet]
[-docletpath, C:\Users\Mathias\Downloads\SimpleLibraryCompiler\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\Java\jdk1.8.0_202\bin\..\jre\lib\jfxrt.jar;C:\Users\Mathias\eclipse-workspace\FirstLib\libs\jep-3.9.0.jar;]
[-sourcepath, src]
[-b4atarget, G:\Mijn Drive\Persoonlijk\Extra b4x Code\Libraries\FirstLib.xml]
[-b4aignore, org,com.android,com.example,com.hoho]
Ignoring: [org, com.android, com.example, com.hoho]
starting....
Working with class: com.mathiasm.firstlib.FirstLib
finish: G:\Mijn Drive\Persoonlijk\Extra b4x Code\Libraries\FirstLib.xml

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


Seems good.. I copy the same jep-3.9.0.jar to G:\Mijn Drive\Persoonlijk\Extra b4x Code\Libraries

The lib shows up in B4J, I use this simple code:

B4X:
'Non-UI application (console / server application)
#Region Project Attributes
    #CommandLineArgs:
    #MergeLibraries: True
#End Region

Sub Process_Globals
    
End Sub

Sub AppStart (Args() As String)
    Dim fl As FirstLib
    fl.Initialize
    fl.Execute("print(1337)")
End Sub

'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    Return True
End Sub


But when I run this code:


B4J Version: 7.00
Java Version: 8
Parsing code. (0.00s)
Building folders structure. (0.22s)
Compiling code. (0.03s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
B4J line: 13
fl.Initialize
javac 1.8.0_202
src\b4j\example\main.java:50: error: cannot access JepException
_fl.Initialize();
^
class file for jep.JepException not found
1 error

No idea why, because in the picture above, the JepException class is clearly visible in the jep-3.9.0.jar.

Anyone has an idea? This might be a very stupid question. Java is not my code habitat.

Thanks a bunch!
 
Top