Home arrow static arrow Java Programming [Archive] - QUICK HELP
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - QUICK HELP
This topic has 4 replies on 1 page.

Posts:2
Registered: 6/14/04
QUICK HELP  
Jun 14, 2004 10:46 PM



 
Hi, I�m from argentina. First sorry my english.
I wanna know how can i associate file extensions with java application.
For Example: when i click into a doc file the Word open the file ando show me the text inside the file.
I wanna do the same with an application that i�m doing.
I don�t know if somebody understand what i�m trying to say, i hope yes.
Thanks
JAVIER
 

Posts:1,995
Registered: 12/10/00
Re: QUICK HELP  
Jun 14, 2004 10:54 PM (reply 1 of 4)



 
I believe this is not a Java question, but a Windows one: how to associate a file extension with an application?
If you right-click on a file in Explorer you have an "Open with" option and inside you have a checkbox to use this application for this filetype
Or again in Explorer menu Tools>Folder Options>File Types.

Hmmm
Mike
 

Posts:208
Registered: 4/23/03
Re: QUICK HELP  
Jun 14, 2004 11:27 PM (reply 2 of 4)



 
ahhh

from what i get youve created an application which uses a file with the extension for example: .bbq

now when someone clicks on a .bbq file you want the application to open it?

associate the file type .bbq as mentioned in the previous post with "java ApplicationName" and then in your program get the filename from the command line arguments thing
public static void main(String [u]args[][/u])
 

Posts:2
Registered: 6/14/04
Re: QUICK HELP  
Jun 14, 2004 11:36 PM (reply 3 of 4)



 
Thanks, the first step it�s obvious, my problem its whit the second step.
I made a bat file like this:

java Principal.Weabis %1

then in the Weabis Class i have:

public static void main(String args[])
{
if(args.length >= 1)
{
String arch = args[0];
System.out.println(arch);
Weabis wi = new Weabis(arch);
}
else
{Weabis w = new Weabis();
}
}

And i have an Exception : main Thread .....java.lang.NoClassFound......

What the problem?
 

Posts:1,695
Registered: 1/13/04
Re: QUICK HELP  
Jun 15, 2004 12:36 AM (reply 4 of 4)



 
Thanks, the first step it�s obvious, my problem its
whit the second step.
I made a bat file like this:

java Principal.Weabis %1

If you run your application this way, you must have previously added in your CLASSPATH variable
the parent folder of the Principal sub-folder OR the folder containing the JAR file of your application.
You can also use the class path option of the java command: java -cp "yourClassPath" Principal.Weabis %1
 
This topic has 4 replies on 1 page.