|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

11-29-2007, 10:23 AM
|
|
Member
|
|
Join Date: Nov 2007
Posts: 5
|
|
|
Main startup class
I have a Flash application from which i call a few java executables that are supposed to open other programs/files etc. Works well from where i'm sitting, but one of my clients is having trouble with it. Whenever he clicks on a button that calls one of the java programs he receives an error that states: "The main startup class could not be found".
Any ideas what could cause this?
|
|

11-29-2007, 10:32 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,581
|
|
|
Main class(actually class which has main method) may be missing. Check whether it is there first.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

11-29-2007, 12:23 PM
|
|
Member
|
|
Join Date: Nov 2007
Posts: 5
|
|
Yup, here's the code i'm using...
import java.util.*;
import java.io.*;
public class OpenFile
{
public static void main(String args[])
{
try{
String userdir = System.getProperty("user.dir");
String parsedUserdir = userdir.substring(userdir.indexOf(":")-1,userdir.indexOf(":")).toLowerCase();
String fileName;
if(parsedUserdir.equals("c")){
fileName = "C:\\temp\\fscommand\\4400796_Diagnosfil_PropPlus_SE.P1D";
}else if(parsedUserdir.equals("d")){
fileName = "D:\\fscommand\\4400796_Diagnosfil_PropPlus_SE.P1D";
}else if(parsedUserdir.equals("e")){
fileName = "E:\\fscommand\\4400796_Diagnosfil_PropPlus_SE.P1D";
}else if(parsedUserdir.equals("f")){
fileName = "F:\\fscommand\\4400796_Diagnosfil_PropPlus_SE.P1D";
}else{
fileName = "G:\\fscommand\\4400796_Diagnosfil_PropPlus_SE.P1D";
}
Runtime rt = Runtime.getRuntime();
Process proc1 = rt.exec( "cmd /C start "+ fileName );
proc1.waitFor();
}catch(Throwable t){
t.printStackTrace();
}
}
}
|
|

11-29-2007, 12:43 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,581
|
|
|
This code is ok. If the correct file in correct drive/path it opens. So what is your issue here.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

11-29-2007, 12:56 PM
|
|
Member
|
|
Join Date: Nov 2007
Posts: 5
|
|
|
Well, one of my clients gets an error when running this. Works well on my machine, but as he runs it on his machine it says "The main startup class could not be found". Could it have something to do with his configuration? (security or whatever...?)
|
|

11-29-2007, 01:05 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,581
|
|
|
I don't think so. This application not deal with such security level. Is that your complete application run on an applet. If so the browser can't be support it. Specially in FF.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

11-29-2007, 01:11 PM
|
|
Member
|
|
Join Date: Nov 2007
Posts: 5
|
|
|
Forgot to mention...it's a standalone flash app, so it doesn't run from a browser. Runs from a CD or usb-drive.
|
|

11-29-2007, 01:15 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,581
|
|
|
Hmm, according to your error message, it wont be related with the wrong file path of the searching file. More possibility to missing the main class, the above class.
You say that the application you have with is working. Can you test your working application on your clients' machine.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

11-29-2007, 05:05 PM
|
|
Member
|
|
Join Date: Nov 2007
Posts: 5
|
|
|
Turned out that they didn't allow JVM on their machines. Problem partially solved, now i just need another workaround. Thanks for the efforts. :-)
|
|

11-30-2007, 04:47 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,581
|
|
Originally Posted by j0h@nb
Turned out that they didn't allow JVM on their machines.
This is interesting. How did you find that JVM not allowed this.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

11-30-2007, 05:44 AM
|
|
Member
|
|
Join Date: Nov 2007
Posts: 18
|
|
|
Have you put it in the executable jar file?
If yes in manifest file you have to specify Main-Class name with full package name.
|
|

11-30-2007, 05:50 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,581
|
|
|
Great, yes it can be a reason. But if he use the same type of package on his message, it wont be happened.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

11-30-2007, 06:35 AM
|
|
Member
|
|
Join Date: Nov 2007
Posts: 18
|
|
|
Package is not a problem in this case.
It seems to problem with not specifying Main-Class attribute in Jar File.
There is no other way this can happen.
Program is correct.
|
|

11-30-2007, 06:44 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,581
|
|
Originally Posted by sandeepkk2005
Package is not a problem in this case.
Sorry you don't get me. What I've mean by package is the whole project. Sorry for the confusing.
Originally Posted by sandeepkk2005
It seems to problem with not specifying Main-Class attribute in Jar File.There is no other way this can happen.
Program is correct.
Yes the program is correct. Actually this is not the only issue on this. j0h@nb says that there is some issue with JVM.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|