Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » using an external Jar / referenced library(calling a class in an external jar)
using an external Jar / referenced library [message #1797061] Wed, 24 October 2018 15:53 Go to next message
Active rfid is currently offline Active rfidFriend
Messages: 2
Registered: October 2018
Junior Member
Appreciate any support on this (after reading many forums I am none the wiser).

If if I put a jar into (Neon.3) WEB-INF/ lib folder then I can import a class from that jar (in my jsp) and run a method against that class.

If however I do not want that jar packaged within Eclipse (I want it to remain completely external) then I add a library linked to that jar and the jar then appears in Referenced Libraries, as expected, but the original import then fails (class / jar no longer found) and I cant run that class. The qualified name is the same.

I can manually open the package and view the class file so I know it is there.

I don't want to have to embed my jar in the Eclipse project because that jar already runs as a 'stand-alone' back-end process, I just want to ensure jsp's in Eclipse can call it / run threads etc.

Is this possible, do I have to move the jar to a different folder?

Regards
Active.

Re: using an external Jar / referenced library [message #1797070 is a reply to message #1797061] Wed, 24 October 2018 18:59 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4430
Registered: July 2009
Senior Member

It's more possible that you need to Validate the JSP again from the file/project context menu. Some changes to the Java Build
Path won't kick off an automatic revalidation.

Also, Neon.3 is no longer the current release. You should upgrade if possible.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: using an external Jar / referenced library [message #1797076 is a reply to message #1797070] Wed, 24 October 2018 20:33 Go to previous messageGo to next message
Active rfid is currently offline Active rfidFriend
Messages: 2
Registered: October 2018
Junior Member
Thanks Nitin for the prompt reply.

Though I always clean / validate as a matter of course after every change and have restarted Eclipse, cleared old files files from lib etc just to be sure.

There are a number of messages and various forums which indicate that something seems to 'break' when external jar's are used (the only solution to this is to import them into the default package).

For example -

"I found that you have to put your .java file in the default package. For example, you will get errors if you put your java code in a package like com.xxx.yyy.ccc" (something which I cant do, the package in my case must commence com. etc as it runs as an existing back-end java process)

I will check for Eclipse updates though I downloaded only a couple of weeks ago and I seem to remember that the latest version had some sort of java comparability issue, hence I used Neon which I am (was) familiar with and is stable on another PC.

Regards
Active
Re: using an external Jar / referenced library [message #1797080 is a reply to message #1797076] Wed, 24 October 2018 22:10 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4430
Registered: July 2009
Senior Member

External jars, by default, won't be deployed to the server, but I really have no idea
why using a package name would be an issue. Maybe they had their project set up
incorrectly.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Oxygen April 2018 - 3A needs "refresh" , won't run execution.
Next Topic:How to uninstall (some) software in Oxygen 3A?
Goto Forum:
  


Current Time: Fri Mar 29 12:38:39 GMT 2024

Powered by FUDForum. Page generated in 0.06500 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top