Product export without a jre. It works but why?

35 views
Skip to first unread message

Java Dev

unread,
Oct 21, 2012, 4:37:39 PM10/21/12
to vog...@googlegroups.com
Hi,

I have a question about export of product.
I export my application and I do NOT bundle a JRE (e.g. paragraph 11.5). And the application works fine.
But I also do NOT have the %JAVA_HOME% set in my PC and do NOT have the jre\bin or javaw.exe or anything in my PATH.
So how does this exported application work? How does it find java? There is NO jre folder in my export since I do not bundle jre.
So I can not understand how this works. Could you please explain this?

Thank you

Lars Vogel

unread,
Oct 21, 2012, 4:40:15 PM10/21/12
to vog...@googlegroups.com
Can you run java on the command line?

2012/10/21 Java Dev <flying...@yahoo.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "vogella" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/vogella/-/QBP6wYaQinkJ.
> To post to this group, send email to vog...@googlegroups.com.
> To unsubscribe from this group, send email to
> vogella+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/vogella?hl=en.

Java Dev

unread,
Oct 21, 2012, 4:51:55 PM10/21/12
to vog...@googlegroups.com
I noticed that if I run java from cmd it runs. But when I do
echo %JAVA_HOME%
No JAVA_HOME is displayed (expected since I have not set it)

and when I do
echo %PATH%

no directory in the PATH points to a java installation. Expected since I have not modified PATH to add java.

But now I can not understand why I don't get Bad Command on running java

Lars Vogel

unread,
Oct 21, 2012, 4:54:01 PM10/21/12
to vog...@googlegroups.com
If java can be found on your command line of course everything works.

Again, please see http://www.vogella.com/faq.html for questions which
are relevant for this group.

2012/10/21 Java Dev <flying...@yahoo.com>:
> https://groups.google.com/d/msg/vogella/-/oNGk7LQcszcJ.

Michael Whapples

unread,
Oct 22, 2012, 3:02:53 AM10/22/12
to vog...@googlegroups.com
You may want to learn about the PATH environment variable, if a directory is in there then commands in that directory will just work at the command prompt. On windows, the windows system32 directory is in the PATH variable by default andjava makes links to the java and javaw commands in this directory when you install it.

I don't know whether the Eclipse based launcher does this but it is also possible to find the java home directory by using the windows registry.

As mentioned this is probably beyond what this list should be for and you may do better looking at how various java launchers work elsewhere (eg. have a look at how launch4j http://launch4j.sf.net works, it uses most of the techniques for finding java installations).

Michael Whapples

On 21/10/2012 21:51, Java Dev wrote:
I noticed that if I run java from cmd it runs. But when I do
echo %JAVA_HOME%
No JAVA_HOME is displayed (expected since I have not set it)

and when I do
echo %PATH%

no directory in the PATH points to a java installation. Expected since I have not modified PATH to add java.

But now I can not understand why I don't get Bad Command on running java


οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½, 21 οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ 2012 11:40:16 οΏ½.οΏ½. UTC+3, οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ vogella οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½:
Can you run java on the command line?

2012/10/21 Java Dev <flying...@yahoo.com>:
> Hi,
>
> I have a question about export of product.
> I export my application and I do NOT bundle a JRE (e.g. paragraph 11.5). And
> the application works fine.
> But I also do NOT have the %JAVA_HOME% set in my PC and do NOT have the
> jre\bin or javaw.exe or anything in my PATH.
> So how does this exported application work? How does it find java? There is
> NO jre folder in my export since I do not bundle jre.
> So I can not understand how this works. Could you please explain this?
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "vogella" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/vogella/-/QBP6wYaQinkJ.
> To post to this group, send email to vog...@googlegroups.com.
> To unsubscribe from this group, send email to
> vogella+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/vogella?hl=en.
--
You received this message because you are subscribed to the Google Groups "vogella" group.
To view this discussion on the web visit https://groups.google.com/d/msg/vogella/-/oNGk7LQcszcJ.
Reply all
Reply to author
Forward
0 new messages