Share My Creation [B4X] [TOOL][SOURCE] lm Snippets Manager

toby

Well-Known Member
Licensed User
Longtime User
@LucaMs, I can only run the app in the IDE with Java 14, which is inconvenient. Are you able to run it from a standalone packager or by double-clicking the jar file?
 

toby

Well-Known Member
Licensed User
Longtime User
The latest version of Java SDK with Java FX that works with B4J 9.8 is Java11. Can you, @LucaMs, make lmSnippetManager3.00 work with Java11?
 

LucaMs

Expert
Licensed User
Longtime User
Last edited:

toby

Well-Known Member
Licensed User
Longtime User
Yes, I can; I have just to remove all the GUI ?
But it works with Java8, at least inside IDE; I just can't create a standalone packager
You can find a lot of posts about it; I had already suggested one to you:
https://www.b4x.com/android/forum/threads/update-openjdk.140167/post-887747
I tried that and it didn't work for me; I'm too lazy to learn JavaFX and set it up manually. I just want to be able to compile a jar file or build a standalone package so that I don't need B4j IDE daily to use your useful tool.
 

T201016

Active Member
Licensed User
Longtime User
@LucaMs, I can only run the app in the IDE with Java 14, which is inconvenient. Are you able to run it from a standalone packager or by double-clicking the jar file?
Hello, @LucaMs
First of all, thank you for providing the new version of lmSnippetManager,
a really useful product for me.

However, recently compiled .JAR won't start (by double-clicking),
interestingly, it starts in the IDE B4J itself.

The project compiles correctly under both Java 14.0.1 and 18.0.1
The changes I made are only the installation to the new version 9.80 B4J in the architecture (64 bit).
Unfortunately, the culprit should be looked for, as usual, in Java itself, can you confirm it?
 

toby

Well-Known Member
Licensed User
Longtime User
However, recently compiled .JAR won't start (by double-clicking),
interestingly, it starts in the IDE B4J itself.

The project compiles correctly under both Java 14.0.1 and 18.0.1
 

toby

Well-Known Member
Licensed User
Longtime User
1, Go-to Control panel ->programs and features
2. Uninstall java 14 and 18 if found.
3. Use java 8 for both b4j and the source code.
4. Compile the project. You should be able to double click the jar file to run it.
 

toby

Well-Known Member
Licensed User
Longtime User
Java 11 was working for me until I installed Java 14, and even uninstalling it wouldn't undo every change to the system. Fortunately I have Acronis trueimage backups which can be used to truly restore my computer system.
 

T201016

Active Member
Licensed User
Longtime User
Java 11 was working for me until I installed Java 14, and even uninstalling it wouldn't undo every change to the system. Fortunately I have Acronis trueimage backups which can be used to truly restore my computer system.

I suppose the same happened after my installation of OpenJDK 14 and 18. Previously, I had the Java 8 version of Oracle, and everything worked for me. But finally, after purging all versions, I went back to Oracle JDK 8 and both .JAR and the .EXE executable - (Launch4j) work.
 

toby

Well-Known Member
Licensed User
Longtime User
I still use Java 8 and so I can run my lnSnippetManager.jar
Your out-of-the-box source code uses java14, if I remember correctly, which led me to believe that it works better or only with java14, wasting a lot of time. ?
 

LucaMs

Expert
Licensed User
Longtime User
Your out-of-the-box source code uses java14, if I remember correctly, which led me to believe that it works better or only with java14, wasting a lot of time. ?
Actually it worked compiling with jdk 14.0.1, now not anymore but I didn't want to investigate (the source has nothing to do with it, since the last update has no graphic parts involved).
 

LucaMs

Expert
Licensed User
Longtime User
I have a new version (3.10) ready, which I haven't shared yet.

The new thing is that it allows you to export all the snippets into text files, inside a folder called "Snippets" (it also creates a very simple manifest.txt file) so that, when you have compressed the folder and the manifest file into a file MySnippets.b4xlib (name of your choice, obviously) you can use them with the new snippets management functionality of B4J (later B4A and B4I).

I haven't found an easy way to have the program itself generate the zip file (.b4xlib). I should probably use this @stevel05's library but I haven't found the necessary jar files.
 

stevel05

Expert
Licensed User
Longtime User
That would be overkill for this situation. You could use any of the zip libraries, Archiver is probably the simplest to just zip a folder. The only issue I have encountered with any of them was trying to zip layout files or more precisely, trying use them once they were unzipped.
 

LucaMs

Expert
Licensed User
Longtime User
I searched the forum so (before your post, Steve, yesterday):

https://www.b4x.com/android/forum/pages/results/?query=zip&prefix=1,2,3,17,24,29&product=b4j


You can see which libraries are listed. They were of no help to me; yours would be fine, most likely, but I didn't find the jar files, as I already wrote.

Now I'll look at Archiver (I don't know if it's for B4J but I always trust your words).

I add a "curiosity". I asked Perplexity (AI like ChatGPT) if there is a way to do this with Windows tools. It suggested me to use PowerShell, even showing me how to do it, but it would only work with Windows 10+ and I still only have Windows 7 (there is a way for this too but "risky").

[Soon I will open a very short thread in "Chit Chat" about these AI aids, a single post will be enough].
P.S. Chit Chat.


Thanks, Steve.
 
Last edited:

LucaMs

Expert
Licensed User
Longtime User
Now I'll look at Archiver (I don't know if it's for B4J but I always trust your words).
It is.

In any case, I have to modify the new part quite a bit, the export of the snippets, because I made a mistake: I didn't think ?
When the task is apparently very simple, you usually don't think much (I suppose it happens to everyone). The export obviously works, but it creates a single Snippets folder with all the snippets, so a single b4xlib library would be created but this is wrong, as it will be necessary to create one for each language to be able to use them effectively.
 

LucaMs

Expert
Licensed User
Longtime User
Finally and OT, before even making the changes...

I asked Perplexity how to share a file using Google Drive without having to manually add, one at a time, the emails of N people but recovering the ones already used for another shared file (I don't remember if I succeeded, it's been too long).

As often happens... it responded by making a big mistake.
 

Magma

Expert
Licensed User
Longtime User
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…