File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why Just run in my PC ?

 
Adriano Ferreira
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless. So what goes wrong? What error messages do you get?
 
Adriano Ferreira
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know. What debugging do you have in your code?
 
Adriano Ferreira
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Adrabi Abderrahim
Greenhorn
Posts: 8
Eclipse IDE Fedora Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
Firefox Browser Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
Firefox Browser Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok Thank you for the help. I will try see the event viewer

Thanks a lot
 
Adriano Ferreira
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Adriano Ferreira
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
Firefox Browser Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your answer, but How can I do it?

Im waiting ;D
 
Philip Persson
Greenhorn
Posts: 20
Firefox Browser Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people!!

I came back again.

This is the error that appears on the screen.



Someone understands it?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Adriano Ferreira
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, My Application is running out of IDE.

What should I do?

Thanks
 
Adriano Ferreira
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I tried increase memory but appears the same error on screen...

Please someone, can help me...

 
Adriano Ferreira
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the machine where I develop the program it runs without errors...
 
Adriano Ferreira
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic