B4J Question My JAR is OK with win 7, win 8, but NOT in win 10

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends,

please help me. I run my JAR file on many computers, but now I cant run it on windows 10.
Please see screenshot in attachement where are infos from console.

Please very much, what can I do with this error?

Thank you
p4ppc
 

Attachments

  • javaerrorrun.jpg
    javaerrorrun.jpg
    89.5 KB · Views: 386

petr4ppc

Well-Known Member
Licensed User
Longtime User
With new version B4J I find mistake in part of code:
B4X:
Sub Sleep(ms As Long)
   Dim jo As JavaObject
   jo.InitializeStatic("java.lang.Thread").RunMethod("sleep", Array As Object(ms))
End Sub

B4J is writing: Sleep is not valid identifier

Please what can I do?
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
I delete function Sleep from project, I compile my project with new version of B4J and the same mistake exist, please see the attachement

Now I am trying simply code try.jar (only button on layout). With this I get the same mistake which you can see in screenshot.

In B4J , Libraries folder I am using jna-4.0.0 file

In B4A if I am trying create layout, then I set new name and after confirm this name I see only black windows and this window crashed. I cant create layout.

Please very much for advice
 

Attachments

  • javaerrorrun.jpg
    javaerrorrun.jpg
    89.5 KB · Views: 322
  • try.jar
    363.1 KB · Views: 300
Last edited:
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
In B4A if I am trying create layout, then I set new name and after confirm this name I see only black window and this window crashed. I cant create layout.

I have read thread but I cant find the advice, I am using jdk1.8.0_171

Please do you have some advice?
 
Last edited:
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
DonManfred -
I have PC with windows 10 and I am doing now same steps as many years,
I am trying run empty simlpy layout with only one button and when I am trying create layout, then after I set new name and after confirm this name I see only black window and this window crashed. I cant create layout.

I am trying this on empty project
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
Please can you send jar file of your uploaded project DonManfred?
Please only opinion - It is possible to run APPS in WIN 10 which I have created with external designer for example 2 years ago?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I dont know. I guess B4J is not compatible with the SceneBuilder Layouts.
I think it is recommended not to use the SceneBuilder

Please can you send jar file of your uploaded project DonManfred?
Please find the JAR attached
 

Attachments

  • testlayout.jar
    363.8 KB · Views: 282
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
You are using an FXML layout file, have you tried creating the layout with the in built designer and then trying your program?
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
Daestrum - yes I have tried this.

I have tried creating same layout as DonManfred with in built designer. This project I can run with B4J, but Jar file I cant run in windows, only black window I see and after 1 second it crashed.
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
DonManfred - I cant run your JAR file in Windows (black windows that crashed)
but
I can run your project with B4J (I see layout with button)

Please what can I do?
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
It is possible that I have mistake in settings for Java in windows. But DonManfreds project is functioned in my B4J, so the settings in windows is ok, I think. It is true?
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
How are you running the jar file ?
Double clicking or from a batch file ie java -jar ???.???
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
Daestrum

open with standard double click and open with program JAVA SE platform binary,
System variables %JAVA_HOME%,
version JDK 8.171 a 8.172 and 10.0.1
But nothing...
Please very much for help

I am trying this

C:\Users\pc>java -version
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
if you open a command prompt window and type
java -version

what does it return ?
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
Now I am trying this version:
C:\Users\pc>java -version
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

before this version I have tryed 8.171 and 8.172 version

because I have read on this forum that for Win 10 it must be higher then 8.30 version
 
Upvote 0

petr4ppc

Well-Known Member
Licensed User
Longtime User
stevel05

I am running now

C:\Users\pc>java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

and I have same situation - black window.

but now with order C:\Users\Tom>javac
I get:
'javac' is not recognized as an internal or external command,
operable program or batch file.

Please do you have set %JAVA_HOME% in environment variables or not?
and in row "path" do you have set the way to BIN folder of JRE and JDK?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
In Path I have D:\Programs\Java\jdk1.8.0_172\bin

I also have
JAVA_HOME D:\Programs\Java\jdk1.8.0_172
CLASSPATH %JAVA_HOME%\lib;%JRE_HOME%\lib
JDK_HOME %JAVA_HOME%
JRE_HOME D:\Programs\Java\jre1.8.0_172
 
Upvote 0
Top