LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-13-2013, 03:15 PM   #16
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783

still need a direct link to website
I have this
http://www.wirelessglue.com/#!/page_HOME

but nothing obvious jumping out

new plan

install VirtualBox, then install Linux, ( debian , ubuntu , mint all the same to me )

sadly I won't be 'here' to help

tip for super quick sunjava
Code:
deb http://ppa.launchpad.net/webupd8team/java/ubuntu/ precise main 
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu/ precise main
just in case OpenJDK falls over
https://launchpad.net/~webupd8team/+archive/java

@Jagdriver
don't worry, everyone else knows what that is for

Last edited by Firerat; 09-13-2013 at 03:17 PM.
 
Old 09-13-2013, 03:22 PM   #17
Jagdriver
LQ Newbie
 
Registered: Sep 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Makes sense, ntubski....

Note that I already have a CLASSPATH env var that points to the location of all of the .jar files, so perhaps it's as easy as a simple M$-style modification to the last line?

#!/usr/bin/env sh
scriptdir=`dirname $0`
classpath="$scriptdir/lib/antlr-2.7.7.jar:$scriptdir/lib/mysql-connector-java-5.1.20-bin.jar:$scriptdir/lib/hibernate-commons-annotations-4.0.1.Final.jar:<a whole bunch of other jar files>:$scriptdir/lib/org.hibernate.common.hibernate-commons-annotations-4.0.1.Final.jar:$scriptdir/lib/gluetop_2.10-0.1.4.jar"
exec java -Dhttp.port=9999 $* -cp "$classpath" play.core.server.NettyServer `dirname $0`

@FireRat, there is nothing at the company's website to link to; that isn't an option.

Last edited by Jagdriver; 09-13-2013 at 03:27 PM.
 
Old 09-13-2013, 03:50 PM   #18
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
I think it should be something like this:

Code:
:: put this in a file called start.bat
set scriptdir=%~dp0
set classpath=%scriptdir%lib/antlr-2.7.7.jar;<etc...>%scriptdir%lib/gluetop_2.10-0.1.4.jar
java -Dhttp.port=9999 %* -cp %classpath% play.core.server.NettyServer %~dp0
You might need to put quotes around %scriptdir% in the last line, but if all your paths are without whitespace maybe not. The rules for quoting in batch files are somewhat crazy, you can't just always quote for safety like in unix.

It's also possible it would work from cygwin if you just change the ":" to ";" in the classpath.

Last edited by ntubski; 09-13-2013 at 04:47 PM. Reason: remove stray quote; had %scriptdir% where %classpath% was wanted
 
Old 09-13-2013, 04:12 PM   #19
Jagdriver
LQ Newbie
 
Registered: Sep 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Aaargh...

C:\WirelessGlue\Software\gluetop-0.1.4>start.bat
The input line is too long.
 
Old 09-13-2013, 04:23 PM   #20
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Hmm, if all the jars are in the same dir maybe using wildcard in the classpath as mentioned in that link from YankeePride13 would help:
Quote:
Class path wildcards allow you to include an entire directory of .jar files in the class path without explicitly naming them individually. For more information, including an explanation of class path wildcards, and a detailed description on how to clean up the CLASSPATH environment variable, see the Setting the Class Path technical note.
Code:
set classpath=%scriptdir%lib/*
Oh, also I left a stray quote on that line, not sure if that's relevant.
 
Old 09-13-2013, 04:33 PM   #21
Jagdriver
LQ Newbie
 
Registered: Sep 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Even with your suggestion, it's a heckofa long set of .jar files, so I'd easily still be exceeding the 256-char limit of the M$ world. The .jars all reside in the same directory, however.
 
Old 09-13-2013, 04:34 PM   #22
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
on mobile, I think this


Code:
-cp %scriptdir%lib/*;

as far as I remember the ; prevents expansion, 'in the shell' but java will expand it
 
Old 09-13-2013, 04:38 PM   #23
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by Firerat View Post
as far as I remember the ; prevents expansion, 'in the shell' but java will expand it
No, the Windows shell doesn't expand wildcards. The ; is a separator, don't pass an extra one, java will probably get confused.
 
Old 09-13-2013, 04:40 PM   #24
Jagdriver
LQ Newbie
 
Registered: Sep 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Sorry, FR...... I'm unable to interpret your shorthand. :<(
 
Old 09-13-2013, 04:46 PM   #25
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
I believe the intent was:
Code:
java -Dhttp.port=9999 %* -cp %scriptdir% play.core.server.NettyServer %~dp0
java -Dhttp.port=9999 %* -cp %scriptdir%lib/*; play.core.server.NettyServer %~dp0

:: oops, my original actually should have been
java -Dhttp.port=9999 %* -cp %classpath% play.core.server.NettyServer %~dp0
But like I said the ; is not needed and could cause problems.

It also occurs to me that setting the variable classpath is enough: there is no need to pass the jars on command line again:
Code:
set scriptdir=%~dp0
set classpath=%scriptdir%lib/antlr-2.7.7.jar;<etc...>%scriptdir%lib/gluetop_2.10-0.1.4.jar
java -Dhttp.port=9999 %* play.core.server.NettyServer %~dp0

Last edited by ntubski; 09-13-2013 at 04:50 PM. Reason: %scriptdir% -> %classpath%
 
Old 09-13-2013, 05:29 PM   #26
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
fair enough, distant memory

not lived in windows since 98/99
 
Old 09-13-2013, 05:59 PM   #27
Jagdriver
LQ Newbie
 
Registered: Sep 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
1) The path for all of the .jars is so long that Windows can't handle it. Perhaps I can do this:

set jarpath1=<a bunch of jars>
set jarpath2=<another bunch of jars>
set classpath=%jarpath1%:%jarpath2%


2) Should it really be %scriptdir%lib...etc. Isn't a slash missing, e.g., %scriptdir%/lib...?
 
Old 09-13-2013, 11:20 PM   #28
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by Jagdriver View Post
1) The path for all of the .jars is so long that Windows can't handle it.
The 2 possible solutions 1 possible solution would be:
  1. Specifying the .jars with a wildcard, thereby avoiding passing every single one via command line (this assumes most are in the same directory, not necessarily all but enough to make the list fit under the limit).
    Code:
    set scriptdir=%~dp0
    java -Dhttp.port=9999 -cp %scriptdir%lib/* %* play.core.server.NettyServer %~dp0
  2. Specifying the .jars by setting the classpath variable instead the -cp option, this avoids the command line limit (assumes you don't hit the environment variable length limit, is there one?).
    Code:
    set scriptdir=%~dp0
    set classpath=%scriptdir%lib/antlr-2.7.7.jar;<etc...>%scriptdir%lib/gluetop_2.10-0.1.4.jar
    java -Dhttp.port=9999 %* play.core.server.NettyServer %~dp0


Quote:
2) Should it really be %scriptdir%lib...etc. Isn't a slash missing, e.g., %scriptdir%/lib...?
%~dp0 includes a trailing slash (a backslash, in fact).

Last edited by ntubski; 09-14-2013 at 10:14 AM. Reason: command line limit applies to set commands
 
Old 09-14-2013, 09:52 AM   #29
Jagdriver
LQ Newbie
 
Registered: Sep 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
From M$:

The maximum size of a user-defined environment variable is 32,767 characters. There is no technical limitation on the size of the environment block. However, there are practical limits depending on the mechanism used to access the block. For example, a batch file cannot set a variable that is longer than the maximum command line length.
 
Old 09-14-2013, 10:12 AM   #30
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by Jagdriver View Post
For example, a batch file cannot set a variable that is longer than the maximum command line length.
Okay, that removes solution b then.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ld , adding libraries and the search path info Requested theKbStockpiler General 2 09-09-2010 06:56 PM
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 05:48 PM
Missing some info in kde3.5.2 jiml8 Linux - Software 2 06-21-2006 09:25 PM
Convert an info file(bash.info.gz) to a single html file Darwish Linux - Software 2 09-24-2005 06:51 AM
Missing libraries help / info Balkman Linux - Newbie 2 02-11-2004 09:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration