aspose file tools*
The moose likes General Computing and the fly likes Why Just run in my PC ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Why Just run in my PC ?" Watch "Why Just run in my PC ?" New topic
Author

Why Just run in my PC ?

Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi
I made a program that read files with the extension xlsx, it uses libraries that I always carry with. jar.
In my own machine, the program runs as usual I did, read xlsx files, however when I run it on another machine will not run.

What can be?

Im waiting...
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

ItDoesntWorkIsUseless. So what goes wrong? What error messages do you get?


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Thank you for your answer...
I just run .jar on other machine, but It goes until one part of the code, I know that because Ive a log, but my log doesnt give any errors...

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38840
    
  23
Don't know. What debugging do you have in your code?
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
In my PC when I run the program, it doesnt have erros, but when I use the program in other PC, only like a program, It doesnt do what It have to do.

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14150
    
  18

TellTheDetails. What do you mean with "It doesnt do what It have to do"? It's hard to help you when you don't explain in detail what goes wrong.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Adrabi Abderrahim
Greenhorn

Joined: Jan 23, 2011
Posts: 8

hello,

in your PC, your program read an external files like images, etc ...?
in your PC, you run your program from command line to test it? or just from IDE?
your program use other JARs?
in others PC, you've Java (JDK/JRE) installed? it's some version?

bah etc...!?
Philip Persson
Greenhorn

Joined: Jan 30, 2011
Posts: 20

You said, "it uses libraries that I always carry with. jar."

Is that all it never needs to read xlsx files?

Are both machines the same version of Windows?

Do both machines have the same version of Excel?

Are there any error messages in event viewer that perhaps the JVM threw that were not displayed to the screen or console?

If this is a GUI app, did you try running from the console to see if the errors appeared on the command line?
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi!

Thanks for all the replies

Adrabi Abderrabin
, yes, my program read files, in this case read XLSX files
In my PC I just run from IDE or I execute the .jar, it runs normally.
Yes, My Program use others JARs, for reading xlsx files.
Yes, Its the same version my JRE installed in the other PC, It is a server.

Philip Person
I have using this libraries for reading xlsx files.
The Machines are not the same version, the other machine is a server.
What is event viewer?
How do I run a GUI app from the console? If It is just run the Gui, I do this but no one error appear...

In my computer I run the app Gui without no problems, but on the server it doesnt run yet...




Philip Persson
Greenhorn

Joined: Jan 30, 2011
Posts: 20

In a Windows machine you would use the event viewer to view system, security, and application errors on the machine. It is a feature of the operating system. In modern versions of Windows you right-click on "My Computer" and choose "Manage" to get there.

When I said "run from console" I meant run it from a command line, a command prompt, or what used to be called a DOS prompt back when Windows was still based on DOS.

If you have Microsoft Office installed on your machine but it is not installed on the server, it is possible there is some DLL missing on the server that your application needs but I am just guessing.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38840
    
  23
No longer a "beginning" questtion. This sounds possibly a Windows-specific problem, so I shall try moving this thread to "General Computing".
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
ok Thank you for the help. I will try see the event viewer

Thanks a lot
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi I didnt reach to see the event viewer of Windows.
I thank you for the help but I still didnt run my program on other machine, that is a server...

What would happened?

Thanks
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

Reading between the lines, it sounds like your program has a Java GUI (Swing or AWT). Tell me about the "server". Is it also a Windows computer, or maybe it's Linux or some other form of UNIX? How do you run the program on the server -- do you go somewhere and sit down in front of it, or are you using SSH or Timbuktu or what?

If it's a GUI app, and you don't physically go and sit down in front of the server, then you may need to make some kind of special arrangements to have the GUI show up for you. What sort of arrangements those are depends on the answers to the questions above.


[Jess in Action][AskingGoodQuestions]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14150
    
  18

You still did not explain what you mean by "It doesnt do what It have to do".

What is the purpose of the program?
What do you expect the program to do?
What does it actually do when you try to run it?
Do you get any error messages? If yes, then what exactly are the error messages?

Adriano Ferreira wrote:In my computer I run the app Gui without no problems, but on the server it doesnt run yet...

What does that mean, "it doesnt run yet"? What happens exactly when you try to run the program on the server?
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
My program has to read a XLSX file on the server but it just go until one part of processes,
My program stops when it verifies if exists files in the folder.
No one error appears, Im run the app GUI.

Thank you
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

What have you done to debug this? (It is you code, after all. Either use a debugger to step through the code or write to a log.)

Post the method within which the app stops working, and highlight the line where it stops at. (P.S. You can find the place where the app hangs by getting a JVM thread dump - that should make it easy to spot what to post.)


JBoss In Action
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi Im back, I tried to get the error at a log, but It doesnt appear there.

Im trying get the error...

please help me

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

I'm sorry, but as long as you refuse to provide any concrete information about your code and the error you are getting, we can't help you. The only advice I can offer is: fix your code. If you want more detailed advice, provide the information we asked for.
Philip Persson
Greenhorn

Joined: Jan 30, 2011
Posts: 20

Did you run it from a command console? Did you get a thread dump? What did that tell you? No one here can help you without more information. Once you have the thread dump and can see where your application is running into a problem, you should be able to fix it.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Thank you for your answer, but How can I do it?

Im waiting ;D
Philip Persson
Greenhorn

Joined: Jan 30, 2011
Posts: 20

In a previous post, someone directed you to the following link which has detailed instructions for creating a thread dump. Did you follow those instructions? If so, at what point did you encounter problems? Which instructions in that article were not clear?

http://www.crazysquirrel.com/computing/java/basics/java-thread-dump.jspx
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi people!!

I came back again.

This is the error that appears on the screen.



Someone understands it?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Finally, real information!

This error means that the app (or some JAR) was complied with one level of Java and are trying to run it with an earlier level of Java. I would guess that the JAR was compiled with JDK 6 and you are trying to run it with JVM 5. Either use a more recent JVM to run the app, or compile the JAR with an older JDK.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Thank you very much!!! for your answer
But Now I appears other error on the screen:



Someone knows what is it?
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Yes, your Java application has run out of memory, which means it either has a memory leak or you need to give it more memory to run with. How to do this is dependant on how you are launching the JAR, is it still launched from inside the IDE?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
No, My Application is running out of IDE.

What should I do?

Thanks
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi It's me again...
Is so stranger it happens with my application because I run the app on a server that has 8GB...

please, someone helps me
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Which IDE? You need to research on how to give more memory to the Java VM for a running application via the IDE (on the command line this would be something like -Xmx1024m for example)
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Adriano Ferreira wrote:Is so stranger it happens with my application because I run the app on a server that has 8GB...

That makes no difference if you don't give Java a big enough heap. Exactly how do you go about running your app? Within Eclipse (or NetBeans, or any IDE for that matter), have you configured the app to run in its own JVM? If you have, then there is a tab on the run configuration page where you can provide the -Xmx setting that Martijn mentioned.

If you have not configured the app to run in its own JVM, then you need to increase the heap for Eclipse. You can do this by editing the eclipse.ini file (change the setting in the last line). Other IDEs will have similar means to increase their heaps.

The other possibility is that you app has a memory leak or is doing something silly (like trying to load a 1GB file into memory, or attempting to allocate a huge array). In which case you have to fix your app.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi I tried increase memory but appears the same error on screen...

Please someone, can help me...

Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
In the machine where I develop the program it runs without errors...
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi!!
Now Im using the file XLSX of the server, and now is ocurring the error, I think is the file is very big.
What should I do?

Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

We cannot help you unless you provide details. About the only thing I can say is that whatever you did to increase the heap size, you did it wrong. So go and fix it. If you share with us exactly what you did, and what error you are getting now, then we can be more specific about how to fix it.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Okay,
I run my programm for reading a file xlsx that has a small size, and I reach. Now I know when I read a big file xlsx, appears that error:

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Peter Johnson wrote:About the only thing I can say is that whatever you did to increase the heap size, you did it wrong. ... If you share with us exactly what you did.

Please don't ignore portions of question. You still have not answered this part. This part of the question was in response to your post where you wrote "I tried increase memory". EXACTLY how did you "increase memory"?
Jean-Christophe Blanchard
Greenhorn

Joined: Mar 12, 2011
Posts: 6

He,

You can check the memory size of the JVM with that :
long heapFreeSize = Runtime.getRuntime().freeMemory();
long heapMaxSize = Runtime.getRuntime().maxMemory();

so you check the memory size before/after treating small and big file to know more about the problem.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi Im back again I increase Memory to JVM typing this commands on DOS:

assoc .jar

ftype jarfile

ftype jarfile="C:\Arquivos de programas\Java\jre6\bin\javaw.exe" -Xms2048m -jar "%1" %*

But the error appeas yet...

Someone please......

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

I have no idea what "ftype" is, nor how it handles command line parameters. It could be that the -Xmx setting isn't even getting to the JVM.

Try setting _JAVA_LOADER_DEBUG. You can set it to anything. This option causes java.exe to dump the parameters it sends to the JVM. That will tell you whether the -Xmx setting got to the JVM or not.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Just run in my PC ?