Results 1 to 6 of 6
- 07-17-2009, 02:25 PM #1
Member
- Join Date
- Jul 2009
- Posts
- 18
- Rep Power
- 0
- 07-17-2009, 08:51 PM #2
There is no easy way to 'convert' it. A java class file requires the java virtual machine (JVM) to run, so there isn't enough information in a class file to simple make it an exe.
It is possible to compile java code as native code, but this makes it platform dependent.
Its also possible to bundle a java file inside a package and launch it with a script. You could try making a windows .bat (batch file, I assume you use windows). If on unix, you can make a simple shell script that can act as a launcher, and if you are on the mac (the unix way works here too, since MacOS is unix) you can use an app called platypus to turn your app into an application bundle.
The simplest method is to simply put the .class into a jar file, which is double-clickable on any platform with the JVM installed.
- 07-18-2009, 04:54 AM #3
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
put class in jar file and double click it cant work,
read
How to create Setup for java application
useful link found at post #5
- 07-18-2009, 03:40 PM #4
To mtyoung: I don't really know what that post means, the link you sent talks about embedding a local database in a jar, which has nothing to do with this posters question. Embedding a class in a jar will work depending on application- what do you think is in a jar? A collection of class files and associated files. So using the java jar utility and assuming there is a main method, a jar would produce a nice double clickable app.
-
We must be reading different links here. This is the link that I got out of mtyoung's post: Lesson: Packaging Programs in JAR Files (The Java™ Tutorials > Deployment)
which talks about creating JAR files in general, something very appropriate for the original poster to read.
- 07-18-2009, 11:47 PM #6
Similar Threads
-
converting jar to .class or .java
By marmara95 in forum New To JavaReplies: 12Last Post: 10-06-2012, 10:49 PM -
Converting a text file int binary
By sruthi_2009 in forum New To JavaReplies: 0Last Post: 03-23-2009, 03:09 PM -
.class file to .java file
By makpandian in forum New To JavaReplies: 1Last Post: 02-20-2009, 06:46 PM -
Error while converting trace file to readable txt
By suresh in forum Forum LobbyReplies: 1Last Post: 12-04-2008, 07:31 AM -
Converting text file(.txt) to JPG file(.jpg) in java
By javadeveloper in forum Advanced JavaReplies: 0Last Post: 11-09-2007, 04:22 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks