Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Compiled Java files working on one machine and not on another machine??

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have two queries which are as follows:

1)
I had some java classes which i had to compile and move into the production machine.

Now i compiled those files in my development environment and moved the class files to Production.But they didnt worked there.

My Development environment consists of: Windows XP,Apache Tomcat Webserver 4.1,jdk1.3.1_01
My Production environment consists of: UNIX,Weblogic 6.1 ,jdk1.3.1_01(which comes included with weblogic by default)

Now what i would like to know is this:

Java is a platform-independent language having only the difference between JVM's for different machines which interprets the generated bytecodes.So the files compiled on any machine should work properly wherever a JVM is present no matter on which machine the JVM is there(Please correct me if i im wrong)??

But the files compiled on my development machine didn't worked on the production machine.But teh same when i compiled on the Production machine it worked smoothly.So can you people please explain me why it behaved like this??


2)If any application server/webserver includes the Java Software Development kit

AND

if i have JDK installed on the same PC at some other location(excluding appserver/webserver version)

then when the applications is deployed and accessed which JDK version the Application will
use??

Thanks,
Jignesh
 
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a few issues where bytecode will not run properly on different platforms. The one I usually have trouble with is simple, and has to do with / vs \ when accessing files in different folders in windows and linux.

Is it not running at all, or are you getting runtime exceptions? If the latter what are they? Give specifics of the problem. Saying it doesn't work isn't all that helpful.
[ August 19, 2006: Message edited by: Rusty Shackleford ]
 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is it not running at all, or are you getting runtime exceptions?



See i mentioned that it's working after compiling the source files on the Production's UNIX machine.

Previously when it was not working i was getting the runtime exception:

java.lang.NoSuchMethodFoundError

So when i looked in to the java docs i found that this exception is usually caught by the compiler but it can occur at runtime only if the class definition is changed incompatibly.

So i compiled the files on the Target machine and they were working smoothly.

So what explaination can you provide about why the class file behaved like this??

Also please let me know about my second query also??

Jignesh
 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody please solve my above mentioned doubts ??
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have the same version of Java on both machines?
Do you have the same version of any additional libraries on both machines?

It sounds like you have a version conflict somewhere; on the development machine you are using version X of some library, and on the production machine an older version Y is installed, that doesn't have the method that's available in version X.

Look at the error message. It should tell you which method is not found. Then look at the documentation of the library that the method belongs to and find out in which version that method was added.
[ August 25, 2006: Message edited by: Jesper Young ]
 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jesper,

Thanks for the reply.

See as i told the problem is now resolved but i would like to know why the files compiled on Development Windows Machine didn't worked on the Production Unix Machine.

No there are no versiion conflicts .On my Windows Development environment it is jdk1.3.1_01 and in the Production UNIX machine in the weblogic6.1 server in which the web application is deployed also consists of jdk1.3.1_01.

Can this be the problem that the webserver/application server consists of inbuilt jdk and also there is another jdk version installed on the same machine but at some different locations.If this is the case will the web application use the inbuilt jdk version of webserver/application server or the other version installed.
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic