Win32 programming with Java?

1. Is the above possible? Does Java provide classes to be able write win32 programs?

2. Can I write a Java Service to run on a NT box? If so how?

3. Can I make a set of Java classes into an Win32 executable?

4. With Java how can I retrienve/update NT registry entries. I don't think I can use the Java.lang.System class right? If not, how do I go about this?


sora
LVL 5
soraAsked:
Who is Participating?
 
Jim CakalicConnect With a Mentor Senior Developer/ArchitectCommented:
Hi. To add to the previous comments:

1) These packages are open source
http://staff.develop.com/halloway/code/jawin.html
http://www.rolemaker.dk/JWindows/index.htm

And these are commercial
http://www.excelsior-usa.com/xfunction.html
http://www.nevaobject.com/_docs/_coroutine/coroutine.htm

2) I've had really good success with JavaService.
http://www.alexandriasc.com/software/JavaService/index.html

3) Microsofts Java SDK contains a utility called jexegen. It requires the Microsoft IE JVM on the target.
http://www.alexandriasc.com/software/JavaService/index.html

Executable "wrapper"/launcher technologies?
http://mpowers.net/executor/
http://www.ucware.com/jexec/
http://www.rolemaker.dk/nonRoleMaker/javalauncher/marner_java_launcher.htm

Interesting article on pros/cons of compiling Java to native code
http://www-106.ibm.com/developerworks/java/library/j-native.html

This page lists a number of commercial Java native code compilation technologies for various platforms
http://www.geocities.com/marcoschmidt.geo/jcomp.html

4) Use one of the Win32 API packages. Also had good success with the previously named JST package.
http://www.jobjects.com/products/jst/

Best regards,
Jim Cakalic
0
 
Oliver_DornaufCommented:
1) no. Java classes can only run on a Java Virtual Machine wich runs under WIN32. But you can call WIN32 dlls etc using the java native interface.

2) http://www.eworksmart.com/JNT

3) see java native interface

4) NO. You have to write a win32 dll to retive this values and use the java native interface to call the dll. Because java is plattform independ)

Look at http://www.beq.ca/downloads/jreg aus an example to read registry values and using the java native interface


0
 
mallyhCommented:
2 and 4 Yes: http://www.jobjects.com/products/jst/

Services, no problem, registry access no problem.

1. The answer is definately no.

3. Only by cheating, Visual Cafe and Supercede and
no doubt a few others provide this functionality, but
it is not an executable which you can distribute without
a whole load of dll's which really just contain the
JVM (OK I am sure they contain something totally different), but thats the effect as they do not run as fast as a
win32 application would).
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
soraAuthor Commented:
Thanks guys for the wonderful answers. I will split the answers among all of you. Exactly in what proportion - I will need some time go through the links you posted to decide.

Thanks again!

sora
0
 
Venci75Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
split points between: jim_cakalic, Oliver_Dornauf, mallyh
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venci75
EE Cleanup Volunteer
0
 
Jim CakalicSenior Developer/ArchitectCommented:
OK. Thanks.
0
 
NetminderCommented:
Per recommendation, force-accepted.

Netminder
EE Admin

Oliver_Dornauf: points for you at http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20516486.html
mallyh: points for you at http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20516487.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.