Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Windows Java program in linux?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1331

PostPosted: Tue Feb 20, 2018 10:26 pm    Post subject: Windows Java program in linux? Reply with quote

Greetings all
I occasionally use what appears to be a Java program called HOBOware on a windows laptop for work to download some data off a data logger (to a csv file). The windows laptop has gotten some kind of hardware issue and windows wont boot reliably. So I am curious if I could just run a windows java program in Gentoo?
Messed around with wine a little, but if its native Java perhaps no need for wine?
Java = Java no?
Has anyone attempted something similar?
Thanks in advance

UPDATE: I was able to extract the setup file using app-arch/innoextract-1.6, and now I can see the .jar files:
Code:

HOBOPersistence-1.0.4-SNAPSHOT.jar              log4j-1.2.16.jar
asm-3.0.jar HOBOwareClassesObs.jar
etc etc..
and I have a .vmoptions file:
Code:
-Xmx1024m
-XX:MaxPermSize=128m
-Dsun.locale.formatasdefault=true
-Dfile.encoding=UTF-8
-Xbootclasspath/a:%EXE4J_JVM_HOME%\lib\jfxrt.jar
-Dorg.apache.jasper.compiler.disablejsr199=true

_________________
Donate to Gentoo
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2470

PostPosted: Wed Feb 21, 2018 12:26 am    Post subject: Reply with quote

Java is java unless they import some windows specific code into it. If that is the case they are doing java wrong. It was designed to be OS and hardware independent.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1331

PostPosted: Wed Feb 21, 2018 2:08 am    Post subject: Reply with quote

Thank you DR that's encouraging I'll keep poking around.
The main program seems to be HOBOware.exe I did a
Code:
objdump -x -D HOBOware.exe | less

and it seems to be a ton of stuff in there.
Completely guessing I assume i would have to replace the functions in HOBOware.exe with my own java executable and load the java Jars in app/Jars
innoextract got me a nice directory structure to look at:
Code:
ls
 default.jpg        HOBOware.vmoptions           jspWin.dll           PresentationLayer-HOBOwareJava7.war
 en_US              ICE_JNIRegistry.dll          jssecacerts          Processors
 fxc.dat            Jars                         Microsoft.VC80.CRT   README.rtf
'H21-USB Drivers'   JavaDLL.dll                  ousbce.dll           WinFoldersJava-1.1.dll
 HOBONodeWeb.war    jre-8u131-windows-i586.exe   ousb.dll             WinFoldersJava_x64-1.1.dll
 HOBOware.exe       jre-8u131-windows-x64.exe    Plugins

The directory Jars is loaded with files.
Lots of the Jars are publicly documented like serialio-3.0.jar
I would be pretty excited to talk to the data logger without using windows.
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 12711

PostPosted: Wed Feb 21, 2018 2:17 am    Post subject: Reply with quote

HOBOware.exe might be a simple wrapper that runs java.exe (or similar) with the right options. When you run it under Windows, do you see any processes descended from HOBOware?
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2470

PostPosted: Wed Feb 21, 2018 4:09 am    Post subject: Reply with quote

Sounds like they are doing java wrong. A java "executable" is a .jar file. If you run java -jar <file>.jar it should execute. After all, we can all still play Minecraft. I would expect the log4j-1.2.16.jar or HOBOPersistence-1.0.4-SNAPSHOT.jar would be the application in question.

Of courses it is possible that it is simply meant to run java with certain options or it could mean they are attempting to lock in "their" program with some back door DRM.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1331

PostPosted: Wed Feb 21, 2018 4:11 am    Post subject: Reply with quote

Hu wrote:
HOBOware.exe might be a simple wrapper that runs java.exe (or similar) with the right options. When you run it under Windows, do you see any processes descended from HOBOware?

Looking with the 'process internals' it seems to run by itself. I am not much of a windows expert though.
Any suggestions for looking closer?
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2361

PostPosted: Wed Feb 21, 2018 4:29 am    Post subject: Reply with quote

Java is Java, as was said above.

However, Windows programmers tend to think that they're the only ones who run Java, and they make all sorts of assumptions about where their apps will run.

This is particularly true with older code, and with programmers who spent significant time programming on Windows and are either relatively new at Java or have been told bad information about the execution environment.

There are lots of ways in Java to find out what OS you're running on, where to put files and the endless other things you need to know to run in a multi-platform environment. But if the programmer hardcodes

Code:
File file = new File("C:\...");


then there's nothing you can do about it.

I agree that the Windows executable may be a wrapper, or it may be a Java app compiled into machine-specific code like some Java compilers have been known to do.
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1331

PostPosted: Wed Feb 21, 2018 7:42 am    Post subject: Reply with quote

1clue wrote:
Java is Java, as was said above.

However, Windows programmers tend to think that they're the only ones who run Java, and they make all sorts of assumptions about where their apps will run.

This is particularly true with older code, and with programmers who spent significant time programming on Windows and are either relatively new at Java or have been told bad information about the execution environment.

There are lots of ways in Java to find out what OS you're running on, where to put files and the endless other things you need to know to run in a multi-platform environment. But if the programmer hardcodes

Code:
File file = new File("C:\...");


then there's nothing you can do about it.

I agree that the Windows executable may be a wrapper, or it may be a Java app compiled into machine-specific code like some Java compilers have been known to do.

Thanks that's interesting and encouraging. I am going to try to write a basic java program to poke the classes/functions in the .jar i can see. I have never programmed in Java.
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
Goverp
Guru
Guru


Joined: 07 Mar 2007
Posts: 589

PostPosted: Wed Feb 21, 2018 8:30 am    Post subject: Reply with quote

The appearance of several .dll files in the package suggest the Java code is using JNI -i.e. calling native Windows code from Java. Which will break on a straight Linux setup unless the native libraries are in packages that come with Linux versions to replace the Windows ones. You might find it would work under Wine, but my guess is not.
_________________
Greybeard
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1331

PostPosted: Wed Feb 21, 2018 5:58 pm    Post subject: Reply with quote

Goverp wrote:
The appearance of several .dll files in the package suggest the Java code is using JNI -i.e. calling native Windows code from Java. Which will break on a straight Linux setup unless the native libraries are in packages that come with Linux versions to replace the Windows ones. You might find it would work under Wine, but my guess is not.

Hmm thats interesting how can I check that with ldd or something?

Here is the output of objdump -x -D HOBOware.exe
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2361

PostPosted: Wed Feb 21, 2018 6:52 pm    Post subject: Reply with quote

Hoboware has a forum. Have you looked there?

They also have a Mac version which is considerably smaller. It may be that those Windows binaries are optional? Or maybe the Mac version is Java-only?

You might post a question in their forum on getting the software to work on Linux. We can speculate all day about what's in the .exe and all that other stuff, the official support forum will likely know.

Alternately you might consider a VM with Windows in it. You'll be back into the licensing model of Microsoft, but only for those apps you choose to run on the VM.
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1331

PostPosted: Wed Feb 21, 2018 8:14 pm    Post subject: Reply with quote

1clue wrote:
Hoboware has a forum. Have you looked there?

They also have a Mac version which is considerably smaller. It may be that those Windows binaries are optional? Or maybe the Mac version is Java-only?

You might post a question in their forum on getting the software to work on Linux. We can speculate all day about what's in the .exe and all that other stuff, the official support forum will likely know.

Alternately you might consider a VM with Windows in it. You'll be back into the licensing model of Microsoft, but only for those apps you choose to run on the VM.

I got the work laptop fixed up for now so I would not need a windows VM, but that would be a good thing to have...
I looked at their forum for similar posts and honestly some of the best coders and smartest people I have ever met are here. Those types of forums usually moderated by employees and shut down people wanting to do unsupported 'hackish' stuff like me, or the forum goes away when the company changes ownership or something.
Gentoo forums also has been around a long time now and I know I can come back to old posts here like reviewing old notes ;)

Edit: Excellent point on the mac version ill download that..
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2361

PostPosted: Thu Feb 22, 2018 3:29 am    Post subject: Reply with quote

turtles wrote:
1clue wrote:
Hoboware has a forum. Have you looked there?

They also have a Mac version which is considerably smaller. It may be that those Windows binaries are optional? Or maybe the Mac version is Java-only?

You might post a question in their forum on getting the software to work on Linux. We can speculate all day about what's in the .exe and all that other stuff, the official support forum will likely know.

Alternately you might consider a VM with Windows in it. You'll be back into the licensing model of Microsoft, but only for those apps you choose to run on the VM.

I got the work laptop fixed up for now so I would not need a windows VM, but that would be a good thing to have...
I looked at their forum for similar posts and honestly some of the best coders and smartest people I have ever met are here. Those types of forums usually moderated by employees and shut down people wanting to do unsupported 'hackish' stuff like me, or the forum goes away when the company changes ownership or something.
Gentoo forums also has been around a long time now and I know I can come back to old posts here like reviewing old notes ;)

Edit: Excellent point on the mac version ill download that..


The thing is, that forum has people who actually know about the code you're trying to run. Either they will shut you down like you said, or somebody may give you useful information.

We the Penguins can speculate all day and maybe think of things to try, but if we have a bit more to go on that might make everything easier all around.

Just to itemize, here are things to think on collected from this thread in no particular order:

Those binary files (exe and dll) could be:

  • Actual Windows-specific code with no Java or Linux equivalent.
  • JNI code which may or may not have a Linux equivalent.
  • Java code compiled into platform-specific code, which may be unique or may have a Java byte code equivalent right there in the project.
  • A wrapper around some Java code.


It's possible you could examine the wars and jars inside for classes which either are applets or implement a main(args[]) method.

It's also just possible that that README.rtf has useful information.

Finally, you can google some of those DLL names or figure out words to search based on the name. For example, 'ice jni registry' yields results that may help. javadll may get results that help.

What are in the Jars and Plugins directories? (presumed to be directories)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum