Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Java EE in Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
DarkMoon74
n00b
n00b


Joined: 05 Mar 2011
Posts: 2
Location: Brisbane, Queensland, Australia

PostPosted: Sun Aug 03, 2014 6:50 am    Post subject: Java EE in Gentoo Reply with quote

I'd like to start trying Java EE programming. I've already done a bit with Java SE, and am trying to create a Java app for Google Drive, for which I either have to use a copy-and-paste method between the app and a browser for authentication, or I can use a servlet from within my app. From my understanding, I need Java EE to use a servlet.

Is there a package for Java EE 7 SDK in Portage? I only see sun-j2ee-deployment-bin at v6, but IIUC that's not the SDK. If there is no package, is there anything special I have to do to install it from Oracle in a "proper" way on Gentoo?
Back to top
View user's profile Send private message
RazielFMX
l33t
l33t


Joined: 23 Apr 2005
Posts: 744
Location: NY, USA

PostPosted: Tue Aug 05, 2014 3:06 pm    Post subject: Reply with quote

Install this:

Code:
$ eix oracle-jdk-bin
[I] dev-java/oracle-jdk-bin                                                                                                                                               
     Available versions:                                                                                                                                                 
     (1.7)  ~*1.7.0.60^fs 1.7.0.65^fs                                                                                                                                     
     (1.8)  ~1.8.0.11^fs                                                                                                                                                 
       {+X alsa aqua derby doc examples +fontconfig jce nsplugin pax_kernel selinux source}
     Installed versions:  1.7.0.65(1.7)^fs(04:01:03 PM 07/25/2014)(X alsa fontconfig nsplugin -aqua -derby -doc -examples -jce -pax_kernel -selinux -source)
     Homepage:            http://www.oracle.com/technetwork/java/javase/
     Description:         Oracle's Java SE Development Kit


Note, that due to Oracle's super OSS friendly licenses, you will need to manually download the file. Then, you will need to do the following steps:


  • chown portage:portage <your file>
  • chmod 664 <your file>
  • mv <your file> /usr/portage/distfiles


The end product will look something like this:

Code:

$ ls -l /usr/portage/distfiles/*jdk*
-rw-rw-r-- 1 portage portage 142384385 Jul 21 08:47 /usr/portage/distfiles/jdk-7u65-linux-x64.tar.gz


When you emerge the package, it should give you a URL to download the file from.
Back to top
View user's profile Send private message
Goverp
Guru
Guru


Joined: 07 Mar 2007
Posts: 336

PostPosted: Wed Aug 06, 2014 9:01 am    Post subject: Reply with quote

RazielFMX wrote:
Install this:

Code:
$ eix oracle-jdk-bin
...
     Description:         Oracle's Java SE Development Kit

...

I must be missing something, but that looks to me like instructions for installing J2SE, which he already has working, not J2EE, which is what he wants
_________________
Greybeard
Back to top
View user's profile Send private message
RazielFMX
l33t
l33t


Joined: 23 Apr 2005
Posts: 744
Location: NY, USA

PostPosted: Wed Aug 06, 2014 12:46 pm    Post subject: Reply with quote

Once he has the JDK, he can go here and pull the EE:

http://www.oracle.com/technetwork/java/javaee/downloads/index-jsp-140710.html

And install into his home dir.
Back to top
View user's profile Send private message
forrestfunk81
Guru
Guru


Joined: 07 Feb 2006
Posts: 399
Location: münchen.de

PostPosted: Wed Aug 06, 2014 3:21 pm    Post subject: Reply with quote

Afaik you don't need Java EE for Google Drive development. According to the Quickstart Guide you have to use the Google Drive Java client library.

If you need the Java Servlet API, it is enough to install a servlet container like Tomcat (in portage) or Jetty. They are not fullblown Java EE application servers and support only parts of the Java EE specification (servlets and JSP). If you want to develop real Java EE applications (including EJBs, JMS, JPA etc.), you have to download the JEE application server of your choice manually. None of them is in portage, at least no recent version.
_________________
# cd /pub/
# more beer
Back to top
View user's profile Send private message
Cluracan
n00b
n00b


Joined: 02 Apr 2008
Posts: 6
Location: Brisbane, QLD, AU

PostPosted: Fri Aug 08, 2014 6:54 am    Post subject: Reply with quote

Sorry for the delayed response; the notification got lost in my Inbox. :-S

Thanks for the info. I've already got the Google Drive Java Client Library installed and working, but their examples show an authentication flow where the user has to authenticate using their browser, and then copy and paste a code back into the application. I'd like to try to simplify that, and some of the OAuth2 samples seem to use javax.servlet.http.HttpServletRequest to perform the authentication. Hence, my need. :-)

I think this info should get me started. Thanks again.
Back to top
View user's profile Send private message
sera
Developer
Developer


Joined: 29 Feb 2008
Posts: 992
Location: CET

PostPosted: Fri Aug 08, 2014 8:28 pm    Post subject: Reply with quote

Cluracan wrote:
Thanks for the info. I've already got the Google Drive Java Client Library installed and working, but their examples show an authentication flow where the user has to authenticate using their browser, and then copy and paste a code back into the application. I'd like to try to simplify that, and some of the OAuth2 samples seem to use javax.servlet.http.HttpServletRequest to perform the authentication. Hence, my need. :-).

virtual/servlet-api in the tree lists the providers of javax.servlet.http.HttpServletRequest, make your pick. JavaEE in Gentoo could be sort of a meta package. For professional work I suggest to just install the official one somewhere in your home though.
Back to top
View user's profile Send private message
Cluracan
n00b
n00b


Joined: 02 Apr 2008
Posts: 6
Location: Brisbane, QLD, AU

PostPosted: Sat Aug 09, 2014 2:55 am    Post subject: Reply with quote

So, if I understand correctly, java-virtual/servlet-api v3 can use Resin or Tomcat. But from what I gather, Tomcat is... deprecated? Obsolete? Not recommended? ...and Glassfish is the "official" implementation. I'm assuming that glassfish-servlet-api is the Portage package for that, but that only goes to v2.5, so if I want the latest, I have to download and install java_ee_sdk-7-unix.sh, correct? When I do that, it creates a "glassfish4" directory in my home dir, but it doesn't seem to install everything it needs (notably, it's missing a "glassfish" directory there, and only has "updatetool" and "var"). Am I missing something?
Back to top
View user's profile Send private message
forrestfunk81
Guru
Guru


Joined: 07 Feb 2006
Posts: 399
Location: münchen.de

PostPosted: Wed Aug 20, 2014 1:49 pm    Post subject: Reply with quote

Tomcat is not deprecated nor obsolete. Tomcat is a very popular Servlet Container in the Java world. The latest release was in June, 2014. Glassfish is not the "official Java EE server". It is the reference implementation of the Java EE specification. But there are many more Java EE servers which are "official" Java EE certified. And a part of the Java EE specification is to provide a Servlet container. The Servlet container used in Glassfish is a derivative of Tomcat (with some additions). If you want to use Glassfish, just download the zip file and unpack it to your ~.

But I don't think you need a Servlet Container (or an Java EE Server). To put it simple: a Servlet Container is something like a web server for Java. But if you want to authenticate at an oauth server, your part of the code is not the server but the client. Hence you don't need to implement a Servlet (server part) but an HTTP (oauth) client. You should be able to do this with the Google OAuth2 Java Client
_________________
# cd /pub/
# more beer
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum