VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: Latest version of Java please?  (Read 501 times)

Locator

  • Vectorian
  • ****
  • Posts: 778
Latest version of Java please?
« on: June 17, 2015, 05:12:02 pm »

I am trying to update Java to the latest version, and was wondering if there is a ".txz" version of it available, and where I could find it (according to Java's website, the latest one is version 8 build 45). Your assistance in this matter will be greatly appreciated. Thanks in advance for you're help.
Logged

M0E-lnx

  • Administrator
  • Vectorian
  • *****
  • Posts: 3277
Re: Latest version of Java please?
« Reply #1 on: June 18, 2015, 08:57:59 am »

Short answer: NO

You can build it though. 
here is our build source
https://bitbucket.org/VLCore/vl71/src/7e8271ac1e9322714f94182ffb4bcc49ce94e4e5/var/vabs/jre/src/?at=master

Download your file from java, udate the version number on the jre.SlackBuild file and run it

Locator

  • Vectorian
  • ****
  • Posts: 778
Re: Latest version of Java please?
« Reply #2 on: June 18, 2015, 02:04:27 pm »

Thanks. Now, do I need to do anything with the build source, or is that just to be used as an example?
Logged

roarde

  • Vectorian
  • ****
  • Posts: 625
  • move the needle
Re: Latest version of Java please?
« Reply #3 on: June 18, 2015, 02:50:31 pm »

Only info I see missing is that the source gotten from java should be placed in the same directory as jre.SlackBuild; and you should cd to that directory before starting the build.

The result will be a package in ../
Logged
Robert
VL 7.1 Light

Locator

  • Vectorian
  • ****
  • Posts: 778
Re: Latest version of Java please?
« Reply #4 on: June 18, 2015, 08:14:39 pm »

OK, one last question (I hope): Do I just run jre.SlackBuild, or to I need to use a special program for that?
Logged

roarde

  • Vectorian
  • ****
  • Posts: 625
  • move the needle
Re: Latest version of Java please?
« Reply #5 on: June 18, 2015, 09:38:22 pm »

Run it as root.

Chances are, it didn't make it to your directory marked executable.

'chmod +x jre.SlackBuild' , then './jre.SlackBuild' (you should need the './' part, because the current directory should not be part of root's search path).

--or--

Leave the file as is (after changing the version info, of course) and do:
'sh jre.SlackBuild'. The first line, "#!/bin/sh" is there to get the system to run it with sh; so you can do so manually.

NOTE for those who might visit this thread to find and use VL 7.1 slackbuilds in the future:
  If an eariler version of the package is installed on your system, the slackbuild should be in your own /usr/doc/<package name>-<version>/ directory. Better than half the time, copying the contents of the directory to another location, editing the version (remember to change BUILDNUM appropriately), and running the slackbuild will get a package in ../. If it's a full release of the software (not "beta", "rc", "current" . . .) it's a better idea to request the package in the New Package Requests forum. That way everyone can have access to the package. For packages like discussed here, with an existing slackbuild, the time involved in triggering the build for the repos usually approaches zero.
@Locator: That's not a suggestion to you in this case :). You're using 7.0 which shouldn't pull completed packages directly from the 7.1 repos, iirc. With this type of package, there's a higher probablity than usual that using the slackbuild instead will be successful. We'd like to know how it works out, please.

One other thing: The long hexadecimal part of the URL M0E-lnx gave (7e8271ac1e . . . ) can be replaced by the word: HEAD   That's generally, for when you go looking for packages in general. That will pull up the latest slackbuild we have. Just keep in mind that once in a long while, it'll point to a build source that's just been edited and perhaps won't build. Like I said, "generally". M0E-lnx pointed to a known good source which, for jre specifically, should be used for that until it's outdated.
Logged
Robert
VL 7.1 Light

Locator

  • Vectorian
  • ****
  • Posts: 778
Re: Latest version of Java please?
« Reply #6 on: June 21, 2015, 12:36:22 pm »

Sorry I didn't respond sooner, but I was trying to "digest" the information you gave me (so to speak) - sorry, but I am still rather new at this sort of thing, and the one thing that I'm still not quite clear on is whether I am supposed to download "jre.SlackBuild" or not, and while I'm thinking about it, How, in laymens terms, do I figure out the version info, in other words how, for example, do I rewrite "version 8 build 45"?
Logged

roarde

  • Vectorian
  • ****
  • Posts: 625
  • move the needle
Using SlackBuilds -- jre ( a special case )
« Reply #7 on: June 21, 2015, 09:12:12 pm »

I forgot how confusing a first look at a repo on Bitbucket (or anywhere)is.

@Locator: No, I don't believe you need all the micro-instruction here :D  It's just me taking the opportunity to put all this in the same place :)

Also:
If someone is looking to build the "latest" of something they already have in a stable version, you can look in your /usr/doc directory for the build files rather than having to download them. Sure, several of the packages aren't putting everything needed in there as of this date, but that will be changed as time permits.

First, we need to come in through the "front door" so the right cookies can be set. It's bad that the site is so dependent on them, but that's how it is. The front door:
https://bitbucket.org/VLCore/vl71/src/HEAD

From here on in, use the links on the website for everything instead of retyping a URL or such. This will keep your browser happy. Maybe.  :P   Avoid using your "back", "forward", and "stop" buttons if you can.

The left-hand sidebar: We don't need it today. If it doesn't collapse to a smaller size on its own, there's a grey double-arrow symbol, "<<", to collapse or expand it manually.

Short: The stuff we want is at var/vabs/jre/src. Broken down:
Click the "var" folder. In the address bar of your browser, notice that "HEAD" has been replaced by a long hexadecimal commit ID. Good. It's not the one M0E-lnx gave -- not a problem this time. The ID changes every time there's any change to anything in 7.1. To see how long it's been since the part you're interested in changed, just look at the info to the right of the filenames. If you get jre files soon, they'll be the ones mentioned, in the same version. There are ways to get "back issues" of the files -- exactly how will be left aside for its own topic.

Click "vabs" folder. Now we get a list of every builder that makes what is VL 7.1. Even the ISO's themselves are under here. A few of the builders make more than one package; but navigating through the tree you'll run across  a folder for "almost" every package, save the few that must be built together with another.

We want jre, so pick "jre/src".

We want everything in this directory, including its subdirectories, but don't fetch yet. The one thing not needed is the '.gitignore' file in patches/. That's there to let Git know to keep the otherwise-empty directory. I digress.

There's an easier way to download than navigating through and clicking on each file, then finding its actual download link. I'll take a break, break up the post, and cover that next.
Logged
Robert
VL 7.1 Light

roarde

  • Vectorian
  • ****
  • Posts: 625
  • move the needle
Re: Using SlackBuilds -- jre ( a special case )
« Reply #8 on: June 22, 2015, 12:03:56 am »

Hohkaaay . . .

Before I restart, I should mention that using SlackBuilds from one version of VL for another locally will fail a bit more often than it succeeds. Dependencies. While it's best to start with a freshly minted SlackBuild produced by the latest version of sbbuilder, sometimes editing an existing one from another version is a valid cheat. For jre, I'm hoping that it'll work because cross-platform is Java's whole reason for being in the first place.

Catching up:
We're at https://bitbucket.org/VLCore/vl71/src/HEAD/var/vabs/jre/src. If you came in late, click the link portion of the URL, then navigate the website through to that destination. See previous post.


Note: It's best to do the following ( including the rest of this post ) as a regular user, and not as root.

We need somewhere to put our downloads. It's best to have the same directory structure as jre has on the VL repo. Pick someplace in your home directory for the tree. 'cd' there. Then:

mkdir -p vabs/jre/src/patches
mkdir vabs/jre/src/profile.d
cd vabs/jre/src

"vabs/jre/src" (and profile.d/) are where the files will go. "patches/" remains empty, but habitually creating it is a good idea.

Getting the files:
If clicking on the file links now showing in the browser would access the files, you already know several methods that would retrieve them. But no >:( Those links show an "encapsulated view" of the files; they're not the files themselves. The actual files can be retrieved, in batch, using wget.


(Later . . . )
Happy news for you, folks. While thrashing this out I've become quite tired -- you now get the short version.

Save the following file
var/vabs/src/fetcher
Code: [Select]
#!/bin/sh

cat <<"EOF" |
  COPYRIGHT
  LICENSE
  README
  THIRDPARTYLICENSEREADME.txt
  Welcome.html
  jre.SlackBuild
  slack-desc
EOF

  while read; do
    wget -c \
      https://bitbucket.org/VLCore/vl71/raw/HEAD/var/vabs/jre/src/"${REPLY##* }"
  done

for grabfile in jre.csh jre.sh; do
  wget -O profile.d/"${grabfile}" -c \
    https://bitbucket.org/VLCore/vl71/raw/HEAD/var/vabs/jre/src/profile.d/"${grabfile}"
done

Now do:
chmod +x ./fetcher

From here, retrieving is simple:
./fetcher

NOTICE, please read before building.:  Java is a special case, due to Oracle's terms. Please use your browser to download the file that comes from java.com before running the SlackBuild. The SlackBuild will look for it in its own directory, in this example (..)vabs/jre/src.

FWIW, the url for the above files was gotten by opening the view of jre.SlackBuild, right-clicking on the "Raw" button, choosing "Copy Link Location", then pasting that to the script and editing. There's no "https://bitbucket.org/VLCore/vl71/raw/HEAD" listing, so the only option to automating the download is to repeat the click-through process for each file. Bummer.

Another way to automate the process is to use the Bitbucket API's. Somebody write a program ( or script ) for that. Please.


I'll move along to the actual questions that were asked :P in another post.
« Last Edit: June 22, 2015, 03:57:47 am by roarde »
Logged
Robert
VL 7.1 Light

roarde

  • Vectorian
  • ****
  • Posts: 625
  • move the needle
Re: Using SlackBuilds -- jre ( a special case )
« Reply #9 on: June 22, 2015, 06:28:47 am »

[ . . . ] How, in laymens terms, do I figure out the version info, in other words how, for example, do I rewrite "version 8 build 45"?

One of the things you should have by now is jre.SlackBuild, in <somehomedir>/vabs/jre/src/. Let's look at that. Most SlackBuilds we use were generated by sbbuilder, and have a format we can come to be familiar with. Not the case here, as seen by the license info that heads the file. Past that, we have:

# Note that the slack-desc file mentions the JRE version (edit when upgrading)!
NAME=jre
MAJOR=7
VERSION=7u51
JRE_BUILD=b13
DVER=1.7.0_51


NAME? Heh. MAJOR? Duh. Past that, take the time to get it right. We have the terms:
7u51 b13 1.7.0_51

There's a relation between DVER=1.7.0_51 and VERSION=7u51. As for "b13", that seems to stand alone. By now, you should have manually downloaded the jre .tar.gz file and placed it in <somehomedir>/vabs/jre/src/. All the answers are probably within those files, but it would be nice if we didn't have to extract them yet. Let's see what files are there without unpacking:

tar tf jre-<tab> | less          # <tab> should complete to a filename ending in .tar.gz

(By the way, you can cutpaste this. When selecting, stay on the same line and sweep to the end. After pasting, move the cursor back to the end of "<tab>" and erase it. Tab completion will work, even when there's more text that follows.)

Two things jump out right away. The filename that <tab> completed to contains
8u45

. . . and the top-level directory in the archive is:
jre1.8.0_45

So VERSION=8u45, DVER=1.8.0_45.

JRE_BUILD? Hmm. Ya know, first place to look would be in the files in the top-level directory. Quit "less" (q). We can list only the top-level files:
tar tf jre-<tab> | grep '^[^/]*/[^/]*$' | less
I'll tack a bit of info about what's after "grep" onto the end of all this.

Only file that looks promising is "release". So:
tar xOf jre-<tab> jre1.8.0_45/release    # Writes the file to your screen without creating new files
Nifty command, but there's no help there :-\  OK, read the whole jre.SlackBuild to see how it's used.

JRE_BUILD is set by JRE_BUILD=b15, but that variable isn't referenced again in the script! Before we assume that's just a relic of versions past, read the installation instructions offered by the site where you downloaded the file, java.com. BTW, don't do the instructions. They'll have you put it in the wrong place. And not a hint of what JRE_BUILD or "b15" might be.

Trial and error is the last resort, but speaking of resorts we need to finish this and take a vacation. To keep the line from being used in error by something in the source that might ask for it, we'll leave it as a reminder, but comment it out. Hopefully, if anything needs it, it'll scream for it.

One last thing is left. The comment that was already there:
# Note that the slack-desc file mentions the JRE version (edit when upgrading)!
There's nothing in the slack-desc that mentions versions. Ghost of SlackBuilds past. We wanna use the SlackBuild, not sign up to maintain the package; so just ignore. Pardon me a moment:

Everyone's really busy right now, so would "someone else" try starting fresh with a run of sbbuilder, please? Feel free to ask or rant in "Packager Training and Help". Bear in mind that there are odd licensing issues with this package. Thanks.

We now return to your program. The relevant portion of the SlackBuild now looks like this:

# Note that the slack-desc file mentions the JRE version (edit when upgrading)!
NAME=jre
MAJOR=8
VERSION=8u45
# JRE_BUILD=b13
DVER=1.8.0_45


When you're done, save the file. We'll look at the actual build and install in the next post.

Oops, almost forgot.
^[^/]*/[^/]*$

First off,
man 7 regex
man 1 grep

and websearch: regular expression.

But I'll break this one down. It says "find lines that look like this:"
Start at the beginning of the line (^). Allow as many, or none (*), of characters that are not (^ first inside a [ ]) a "/", then find exactly one "/". After that, none or more non-/ characters ([^/]*) to the end of the line ($).

Lines with only one "/", thus in the top-level directory, if we call "jre1.8.0_45" the top level.
Logged
Robert
VL 7.1 Light

roarde

  • Vectorian
  • ****
  • Posts: 625
  • move the needle
Re: Using SlackBuilds -- jre ( a special case )
« Reply #10 on: June 22, 2015, 07:22:47 pm »

Almost there.

I used the SlackBuild as-is and got a good package. There were a couple of annoyances during the build that are easily fixed: Wget went to fetch the source anyway, despite its being already here in its proper place. After asking the server, it learned we had all of the file and quit so the build went on. Following that, there was a loooong period of blank screen. Finally, it let me out in the wrong directory, then tried to remove that directory.

You should still be acting as a regular user and not root.

So three very simple edits. The first two are marked by "-" for the mistakes, and "+" for the correction. Synopsis:

Move CWD=$(pwd) up a little further so the src/ directory is set before it checks to see if we have $CWD/jre-8u45-linux-i586.tar.gz.
Add pv between the x and f when tar is opening the source file. The "v" makes tar more chatty, filling the screen with signs it's still working.
Code: [Select]
   ARCH=i586
   LIBDIRSUFFIX=''
 fi
 
+CWD=$(pwd)
 
 #get the source..........
 for SRC in $(echo $LINK);do
 if [ ! -f $CWD/$(basename $SRC) ]
 then
  # download jre with cookie
  # http://ivan-site.com/2012/05/download-oracle-java-jre-jdk-using-a-script/
  wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" \
  --no-check-certificate -O $NAME-$VERSION-linux-$JAVA_ARCH.tar.gz -c $SRC
 fi
 done
-CWD=$(pwd)
 cd ../
 RELEASEDIR=$(pwd)
 cd $CWD
 mkdir -p $RELEASEDIR/tmp
 TMP=$RELEASEDIR/tmp
 PKG=$TMP/package-jre
 rm -rf $PKG
 mkdir -p $TMP $PKG
 
 cd $PKG
 mkdir -p usr/lib${LIBDIRSUFFIX}
 cd usr/lib${LIBDIRSUFFIX}
-tar xf $CWD/jre-${VERSION}-linux-${JAVA_ARCH}*.tar.gz
+tar xpvf $CWD/jre-${VERSION}-linux-${JAVA_ARCH}*.tar.gz
 mkdir -p $PKG/etc/profile.d
 for file in $(ls $CWD/profile.d/*) ; do
   cat $file | sed -e "s#lib/java#lib${LIBDIRSUFFIX}/java#" \
     > $PKG/etc/profile.d/$(basename $file)
 done


One more edit to get us back to vabs/jre/src before it finishes. Add cd ${CWD} where shown, very near the end, between makepkg and rm -rf.
Code: [Select]
# We ship the package unmodified, so we do not compress manpages.

cd $PKG
requiredbuilder -v -y -s $RELEASEDIR $PKG
makepkg -c n -l y $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.txz
cd ${CWD}
rm -rf $TMP



Save it. One last thing as normal user:
chmod +x ./jre.SlackBuild


Now you're ready. Just pull the pin . . .
su -lm

       . . . and throw!
./jre.SlackBuild


You'll see a few libraries not found when requiredbuilder is run, and makepkg WARNs about a zero-length trusted.libraries. Neither seems to be a big deal.

When it's complete, you'll see the synopsis. Take a look for the package:
ls ../*.txz

It's there, so install it.
upgradepkg --install-new ../jre-<tab>

Good luck building this on 7.0; let us know how it turns out, please.

Visit java.com, click on the "Do I have Java?" link (below the download button) and follow the prompts to test.
Logged
Robert
VL 7.1 Light

Locator

  • Vectorian
  • ****
  • Posts: 778
Re: Latest version of Java please?
« Reply #11 on: June 23, 2015, 04:12:04 pm »

Thank you very much.
Logged

roarde

  • Vectorian
  • ****
  • Posts: 625
  • move the needle
Re: Latest version of Java please?
« Reply #12 on: June 23, 2015, 06:02:23 pm »

You're very welcome. Did you try it? If so, did that get you a working java?

I had an ulterior motive here. It has been discussed whether, instead of hashing out exactly what Oracle's license means to VL, we should provide an "install or upgrade jre" package that would automate almost all the process.

If this worked on 7.0, that's a good sign. Someone still needs to make up fresh scripts and rearrange those as a package in its own right, if going that way is decided on.

Thing is, I'm not sure you're still on 7.0. Mind letting us know for sure?
« Last Edit: June 23, 2015, 06:05:01 pm by roarde »
Logged
Robert
VL 7.1 Light