Hard Light Productions Forums

Off-Topic Discussion => General Discussion => Topic started by: aldo_14 on February 06, 2004, 11:47:08 am

Title: java -> .exe?
Post by: aldo_14 on February 06, 2004, 11:47:08 am
Anyone know of a method / app  that performs this before I go and search the sun website?  I know of one, but it's trialware and puts message on running the compilerd program  - and I don't want to pay.

Cheers in advance.
Title: java -> .exe?
Post by: Joey_21 on February 06, 2004, 12:20:35 pm
My advice: Learn C++. Alot of the syntax is the same so there really isn't all that much to learn. I found porting code from Java to C++ to be pretty easy back when I began taking C++ classes. Augh, it's been a long time since I used Java for anything though. :doubt:
Title: java -> .exe?
Post by: aldo_14 on February 06, 2004, 12:26:45 pm
Quote
Originally posted by Joey_21
My advice: Learn C++. Alot of the syntax is the same so there really isn't all that much to learn. I found porting code from Java to C++ to be pretty easy back when I began taking C++ classes. Augh, it's been a long time since I used Java for anything though. :doubt:


If I wanted to port back around 10000 lines of WIP project code using java, I would.  But it's completely unfeasible justnow - I specifically wrote the app in java because I know the libraries.... i need an exe to more easily distribute it for testing.
Title: java -> .exe?
Post by: vyper on February 06, 2004, 02:03:21 pm
aldo mate, isn't this completely raping the theory behind the purpose of the JRE and java being cross platform compatible? :wtf:

Anyway....
I can't find anything on the net that's freeware to do this. HOWEVER - is it possible Strathy has some software that can do it? Or does Microsoft? You could get it over the MSDN Academic Alliance.

I'll be quiet now. :bleh:
Title: java -> .exe?
Post by: aldo_14 on February 06, 2004, 02:14:33 pm
Quote
Originally posted by vyper
aldo mate, isn't this completely raping the theory behind the purpose of the JRE and java being cross platform compatible? :wtf:

Anyway....
I can't find anything on the net that's freeware to do this. HOWEVER - is it possible Strathy has some software that can do it? Or does Microsoft? You could get it over the MSDN Academic Alliance.

I'll be quiet now. :bleh:


Yes, it's merely for convenience because I'll probably be distributing it to a few people for testing, who may not necessarily know how to run a java program from the command line and almost certainly won't have classpaths set up (ruling out a bat).  Although they'll probably still need the JRE, it'll at least make it easier for 'em.

I'll have to do a few runtime tests on Unix / Linux now I think of it....

I think Borland JBuilder may be able to do it, but can;t check till I go back to uni on Monday.    There is sod all chance of an MSDN tool, though, as Microsoft seem to detest the cross-platform nature of Java - they were successfulkly sued by sun for creating a java compiler that would only compile windows compatible code.  I believe Ms have a bastardization of Java called J# or J++, although I've yet to encounter anyone who's used it or wanted to.
Title: java -> .exe?
Post by: mikhael on February 06, 2004, 02:47:58 pm
Why can't you just stuff the whole thing in a .jar and distribute that?
Title: java -> .exe?
Post by: aldo_14 on February 06, 2004, 03:17:53 pm
Quote
Originally posted by mikhael
Why can't you just stuff the whole thing in a .jar and distribute that?


I haven;t found anything on self-executable jar files yet, only command-line execution.  I've been considering it, granted.
Title: java -> .exe?
Post by: mikhael on February 06, 2004, 03:54:30 pm
Take 1 jar, add 1 batch file and voila. ;)
Title: java -> .exe?
Post by: aldo_14 on February 06, 2004, 04:25:09 pm
Quote
Originally posted by mikhael
Take 1 jar, add 1 batch file and voila. ;)


Stills needs the classpath to be configured, IIRC.
Title: java -> .exe?
Post by: mikhael on February 06, 2004, 04:36:50 pm
You do that in your batch file.
Title: java -> .exe?
Post by: aldo_14 on February 06, 2004, 05:00:58 pm
Quote
Originally posted by mikhael
You do that in your batch file.


The classpath is installation dependent, I think.  Unless there's some way to fetch it I don't know of.
Title: java -> .exe?
Post by: vyper on February 06, 2004, 05:51:06 pm
n/m
Title: java -> .exe?
Post by: mikhael on February 06, 2004, 06:42:49 pm
Just add something like:
Code: [Select]

set CLASSPATH=%CLASSPATH%;.

This way, if a CLASSPATH variable already exists, its preserved and the current path is appended. If it doesn't exist, its created and ";." becomes the first entry.

That should take care of most of your problems right there.
Title: java -> .exe?
Post by: aldo_14 on February 06, 2004, 06:51:42 pm
Quote
Originally posted by mikhael
Just add something like:
Code: [Select]

set CLASSPATH=%CLASSPATH%;.

This way, if a CLASSPATH variable already exists, its preserved and the current path is appended. If it doesn't exist, its created and ";." becomes the first entry.

That should take care of most of your problems right there. [/B]


s'interesting.  I'll give that a shot, then - cheers.
Title: java -> .exe?
Post by: Kamikaze on February 06, 2004, 07:49:45 pm
Using a JIT compiler, you can make native binaries.

http://www.xlsoft.com/en/products/jet/jetfeature.html <-- like this
Title: java -> .exe?
Post by: Kazan on February 07, 2004, 05:39:51 pm
never use java
Title: java -> .exe?
Post by: vyper on February 07, 2004, 08:29:18 pm
[q]never use java[/q]

What's your beef with the beans?
Title: java -> .exe?
Post by: mikhael on February 07, 2004, 08:31:35 pm
That, Kaz, is like saying 'never use a hammer'. That's dumb. Use the right tool for the job. Unfortunately, Java is very rarely the right tool for the job. ;)

Java is very, very good in its niche. Its very very bad when you attempt to use it outside its niche. ITs like almost every other language.

Of course, I say use Python anywhere you want to use Java. Its generally as fast, faster to start up and has a much smaller memory footprint. But I'm a freak.
Title: java -> .exe?
Post by: Kazan on February 07, 2004, 09:31:23 pm
Give me an instance of when java is the right tool and I'll give you a better tool
Title: java -> .exe?
Post by: mikhael on February 08, 2004, 12:31:03 am
Easy: Java is the exact right thing to use on a hardware java machine, like some embedded devices.

Java is also pretty good for doing small, fast (I know, its an oxymoron: small, fast java) programs for PDAs. Java is your friend if you do stuff for the Sharp Zaurus. Yes, you could use QT and C, but you'll fight for it every inch of the way. Java is a lot easier and faster to work with there. Java is, likewise, the right tool for cell phones, for similar reasons. Basically anywhere its cheap and easy to put the JVM in hardware, Java is the right tool. Anywhere you can't put the JVM in hardware, Java is the wrong tool.
Title: java -> .exe?
Post by: aldo_14 on February 08, 2004, 05:18:34 am
Quote
Originally posted by Kazan
Give me an instance of when java is the right tool and I'll give you a better tool


Any multi-machine / multi-Os programme.  I.e. anywhere where you need cross-platform compatibility with minimal cost.

For example, mobile agents.  Also mobile phones software (i.e. anything where you have components that need to be assembly language-independent and flexible) and other dedicated apps.  

Also certain business and database applications which may need to be migrated across OS's (i.e. http://www.gtnet.com/).

and Kaz - i've heard a lot smarter people than you talking about the uses for Java and the benefits (as well as the problems), so I'm hardly going to take your word for it.
Title: java -> .exe?
Post by: Kazan on February 08, 2004, 10:10:56 am
aldo_14:

Corss platform: C++ using wxWindows

java's supposedly cross platformness is BS -- look a little closer

mikhael is correct about JVM's in hardware

And thanks for the insult asshole - i've only been programming for ten years now.
Title: java -> .exe?
Post by: aldo_14 on February 08, 2004, 11:02:21 am
Quote
Originally posted by Kazan
aldo_14:

Corss platform: C++ using wxWindows

java's supposedly cross platformness is BS -- look a little closer

mikhael is correct about JVM's in hardware

And thanks for the insult asshole - i've only been programming for ten years now.


Insult?  All I stated was that there are people i have talked to or heard from who have better knowledge of you, who have talked about why they use Java for professional applications.  i.e. people who have been programming for longer than 10 years, and who either work academically (i.e. lecturers) or professionally
with java.  In the latter case, who have specifically chosen Java as a business and technological decision over other languages.

And i'm not sure what you're length of experience has to do with my point, regardless.  and frankly, you need to deflate your ego a bit.  Apparently you take a statement that you don't know everything, ever, as an insult and feel obliged to retort in a childish manner which only makes you look like a petty 5 year old.

  Frankly, I'm not sure what you hope to establish by calling me an asshole, other than lowering my opinion of you.

And explain why java is not cross platform?  Unless you're referring to the JVM, in which case NO language can be platform independent (as there is no way to totally disassociate from the base architecture).
Title: java -> .exe?
Post by: Kazan on February 08, 2004, 11:06:41 am
automatically assuming someone knows more than me because they agree with you is an insult -- I have ten years programming expirience and to off handedly dismiss my opinion because people whom agree with you like java have expirience doesn't make them smarter than me

Furthermore I know the man that used to head up the entire developement team for the Mac Newton - he taught me most of what I know -- and he's like mikhael when it comes to java ("It's cool", "It has it's uses" -- DONT try to take it beyond them)

I know a lot of lecturer's that are retards and that I can teach them things about comp sci -- just being a lecturer doesn't make you smart.

There have been a lot of companies that chose java as a business tech -m ost of them die or change their language/focus.


Java's not fully cross platform because it's behavior is not wholly consistant across said platforms.
Title: java -> .exe?
Post by: aldo_14 on February 08, 2004, 11:25:12 am
Quote
Originally posted by Kazan
automatically assuming someone knows more than me because they agree with you is an insult -- I have ten years programming expirience and to off handedly dismiss my opinion because people whom agree with you like java have expirience doesn't make them smarter than me

Furthermore I know the man that used to head up the entire developement team for the Mac Newton - he taught me most of what I know -- and he's like mikhael when it comes to java ("It's cool", "It has it's uses" -- DONT try to take it beyond them)

I know a lot of lecturer's that are retards and that I can teach them things about comp sci -- just being a lecturer doesn't make you smart.

There have been a lot of companies that chose java as a business tech -m ost of them die or change their language/focus.


Java's not fully cross platform because it's behavior is not wholly consistant across said platforms.


i'm astounded at your naivety and arrogance.  

Do you honestly think i judge the intelligence of people on whether or not I agree with them?  Did you possibly anticipate that I might have formed my opinions by listening to people whose opinions and intelligence i respect?

And i notice you throw out yet another random insult at people for no purpose.  you may think some lecturers are retards, but I can ssure you that all the ones I've had contact with at Stratchclyde (except Sotiros - he's a bit of a dick) know what they're talking about.

Not to mention i never proposed Java as a universal answer.  I know it isn't.  but I don't dismiss it out of hand the way you just did - possibly because I have a self interest, but also because i understand that every language has it's uses and can't just be discounted.

(NB:  I can only respond that in my experience I have not experienced an cross-platform behaviour changes.  Without further details, I can't tell if you're referring to the bytecode or the JVM - the latter is more understandable than the former for obvious reasons.)

And stop taking everything as an insult.  Please.  It's embarassing - i can take someone disagreeing with me and repsect their opinions.  

Frankly, my estimation of you goes down with every sneering, self rightous post you make.
Title: java -> .exe?
Post by: Kazan on February 08, 2004, 11:34:18 am
the actual language's behavior changes between platforms in subtle ways that can break complex programs
Title: java -> .exe?
Post by: aldo_14 on February 08, 2004, 11:42:52 am
Quote
Originally posted by Kazan
the actual language's behavior changes between platforms in subtle ways that can break complex programs


Such as?

I need examples or reference here so i can look at this - I don't have the time or means to either test programs on multiformat (well, not today at least) or search for the info.
Title: java -> .exe?
Post by: Kazan on February 08, 2004, 11:53:18 am
i don't write in java, i don't care about java - do you think i bother to remember the subtle ways in which it breaks across platforms.  If you really want to know i suppose i could ask dr Leavens (yes, THAT Dr Leavens.. JML)
Title: java -> .exe?
Post by: aldo_14 on February 08, 2004, 12:01:12 pm
Quote
Originally posted by Kazan
i don't write in java, i don't care about java - do you think i bother to remember the subtle ways in which it breaks across platforms.  If you really want to know i suppose i could ask dr Leavens (yes, THAT Dr Leavens.. JML)


I'd be interested, of course.

  At the moment Java is my sole language (and will be for the forseeable future, until i can find the time to learn an alternate), so I'd be interested in any behavioural quirks that might affect my future work.
Title: java -> .exe?
Post by: Kazan on February 08, 2004, 12:16:10 pm
i highly recommend learning C/C++
Title: java -> .exe?
Post by: aldo_14 on February 08, 2004, 12:18:47 pm
Quote
Originally posted by Kazan
i highly recommend learning C/C++


I fully intend to.  the problem is that i'm working fulltime of a final year project, and I have to find a job after that - which entails using Java.  

So finding the time to learn / migrate to C++ is somewhat difficult... at present my plan is to work in Java over the next few years whilst learning C++ and various graphics APIs.