Solved

Win32 programming with Java?

Posted on 2002-03-21
7
442 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:sora
7 Comments
 
LVL 4

Expert Comment

by:Oliver_Dornauf
ID: 6887970
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
 
LVL 1

Expert Comment

by:mallyh
ID: 6887997
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
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 34 total points
ID: 6889219
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 5

Author Comment

by:sora
ID: 6890445
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
 
LVL 9

Expert Comment

by:Venci75
ID: 7901090
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
 
LVL 19

Expert Comment

by:Jim Cakalic
ID: 7903882
OK. Thanks.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7963118
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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 86
allswap challenge 6 99
runtime exception 2 29
null output 3 25
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question