Executing/Running a Java app

  • theProphecy
  • Newbie
  • Newbie
  • theProphecy
  • Posts: 5
  • Loc: Denmark

Post 3+ Months Ago

Well, might sound easy! :) And it propably is...
But this is my problem: i need a way to execute/run a Java app.
The tricky thing is, that first of all, its for Windows. (Not that i ONLY develop it for Windows, but this way of executing the Java App is for Windows).
It's because when i pack up my app's in a package (zip,rar,gzip,tar...), i whant to put in a shortcut (for Windows) and a runnable script (for Linux), so that nomatter what OS your running, you'll be able to run my app.
The next thing, is that i put a JRE together with it in tha "pack", so that the person using the app, doesn't need to have a JVM installed.
But the big problem is in Windows, because i can't get the shortcut's to point to the folder, from where they are executed.
So i was thinking if there is any other way to run the Java App in windows, for example a .exe file, that just starts the Java app.

This is most likely possible, the only thing is how do i do it? And if it is possible, then i don't have any C/C++/C# compiler/ide/editor, so if it possible to make a .exe, then i would be really happy if i also could get some url's to a developing tool for the language (whatever the .exe needs to be written in). And im not really into C/C++/C#, so if someone could demonstrate it for me! :D

I hope someone can help me out here.. :D It would make me a happy man! :)
  • theProphecy
  • Newbie
  • Newbie
  • theProphecy
  • Posts: 5
  • Loc: Denmark

Post 3+ Months Ago

Right... Sorry, i missed out, i know that a Batch file would do the job.
Code: [ Select ]
@echo off
.\jre\bin\javaw.exe GUI
  1. @echo off
  2. .\jre\bin\javaw.exe GUI

But im sertain that there must be another way. Since i don't like a batch as run very mutch. :)

But the thing with a .exe file, must be possible...
  • theProphecy
  • Newbie
  • Newbie
  • theProphecy
  • Posts: 5
  • Loc: Denmark

Post 3+ Months Ago

Until now i have found out this about running it as a .exe file
Lang = C
Code: [ Select ]
int main()
{
   system(".\\jre\\bin\\javaw.exe GUI");
   return 0;
}
  1. int main()
  2. {
  3.    system(".\\jre\\bin\\javaw.exe GUI");
  4.    return 0;
  5. }

Guess that's the way i'll do it... :D

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 85 guests
  • 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 post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.