Help using jar file!

  • Thread starter smita b via JavaKB.com
  • Start date
S

smita b via JavaKB.com

I have created a jar file by using
jar cvmf Manifest.txt myjar.jar 1.class Mydirectory
In 1.java file :I have used
JEditorPane editor;
editor.setPage(getClass().getResource("/Mydirectory/default.htm"));
If I am only giving myjar.jar file to the client without Mydirectory then
also it is working fine by showing default.htm in JeditorPane.

But my problem is I want to use
Runtime.getRuntime().exec("cmd /c start IEXPLORE"+targetstr) ;
targetstr will be the filename with path of the default.htm
I don't want to give Mydirectory to the client .By only giving jar file it is
not working.

What should I do?
Is there any solution for this?
Using another jar file which will include mydirectory can solve this problem?
Is there any othe concept in java so that I wll be able to hide Mydirectory
from client?

Please help.
 
S

Sharp Tool

I have created a jar file by using
jar cvmf Manifest.txt myjar.jar 1.class Mydirectory
In 1.java file :I have used
JEditorPane editor;
editor.setPage(getClass().getResource("/Mydirectory/default.htm"));
If I am only giving myjar.jar file to the client without Mydirectory then
also it is working fine by showing default.htm in JeditorPane.

But my problem is I want to use
Runtime.getRuntime().exec("cmd /c start IEXPLORE"+targetstr) ;
targetstr will be the filename with path of the default.htm
I don't want to give Mydirectory to the client .By only giving jar file it is
not working.

What should I do?
Is there any solution for this?
Using another jar file which will include mydirectory can solve this problem?
Is there any othe concept in java so that I wll be able to hide Mydirectory
from client?

Please help.

Don't understand your problem.
It does pay to spend some effort in explaining your problem in a short and
concise manner.
 
S

smita b via JavaKB.com

'BrowserLauncher' is much more robust than that.
But i don't want to use it in my application.
using browserlauncher also I will not be able to hide the mydirectory fro
client.
My question is how to hide that directory from client.By only providing the
jar file it should work.

please help.
 
A

Andrew Thompson

But i don't want to use it in my application.
using browserlauncher also I will not be able to hide the mydirectory fro
client.

Why do you feel it is necessary to hide anything
from the end user?
My question is how to hide that directory from client.

Coming back to this for a moment..
editor.setPage(getClass().getResource("/Mydirectory/default.htm"));

What is 'default.html'? If this is your program
documentation, it might be better to write it suitable
for a JEditorPane (and present it in a JEP).
.By only providing the jar file it should work.

I do not understand what you mean by that.
Is the '.htm' file inside a jar file?
please help.

Please stop saying that (sounding pathetic).

...and please consider posting questions to a group for
Java beginners, such as comp.lang.java.help.
[ Known, on your web-interface, as 'first-aid' ]
 
S

smita b via JavaKB.com

Directory smita contains:
1.java [file]
1.class [file]
Manifest.txt [file]
finaljar.jar [file]
Mydirectory [directory] -- contains default.htm

In 1.java I am using :-
I want to start IEXPORE by passig the default.htm from Mydirectory :

default.htm contains a some javascript code & html tags.

For creating jar file I am using :
jar cvmf Manifest.txt myjar.jar 1.class Mydirectory.

I want to only give the jar file to the client & not mydirectory.
Can I do it using another jar or any else ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top