Commit Graph

71 Commits

Author SHA1 Message Date
Olli Helenius b8b3542339 Fix rsync source path designation in preloaded; fixes #246 2018-12-03 22:13:08 +02:00
Olli Helenius b791da704c
Use `preloaded` from `-sbt-dir` 2018-10-17 13:04:39 +03:00
Eugene Yokota 1d806c9cf3 Revert "Use `preloaded` from `-sbt-dir`"
This reverts commit b8dbe42ece.
2018-10-17 01:57:08 -04:00
Eugene Yokota 9c19799b73 Revert "Improve logic for finding preloaded directory"
This reverts commit c8219f8396.
2018-10-17 01:56:57 -04:00
Olli Helenius c8219f8396 Improve logic for finding preloaded directory 2018-10-10 09:36:35 +03:00
Olli Helenius b8dbe42ece Use `preloaded` from `-sbt-dir`
Fixes sbt/sbt#3598.
2018-10-10 09:36:35 +03:00
Eugene Yokota 53e008a25d Revert "Handle SBT_OPTS in bash"
This reverts commit ea93158ae3.
2018-07-30 18:43:53 -04:00
岩松 竜也 ea93158ae3 Handle SBT_OPTS in bash 2018-06-19 01:13:31 +09:00
Jimin Hsieh 1277e55c29 Fix `sbt -help` throw `syntax error` 2018-05-30 22:58:45 +08:00
Jimin Hsieh bc8ed20787 Show default sbt memory size: 1024m 2018-05-30 22:46:28 +08:00
Eugene Yokota 8727faa8b3 forward -debug to sbt
`-debug` is a legitimate command since 0.13.13, but it's been impossible to use it because Bash eats it. This allows log level to be set to debug level. (similar to `-warn` setting to warn level)

Ref https://github.com/sbt/sbt/pull/2742
2018-04-06 08:26:28 -04:00
Eugene Yokota a638ad49ac Fix bash number comparison
This adds JDK 10 and 11 testing on Linux
2018-04-06 05:23:14 -04:00
Eugene Yokota 21cf71e384 more portable jdk_version function
I've reimplemented java version detection as a bash function.
This no longer uses grep.
Also this no longer uses `?` in sed, which doesn't work on macOS.

Fixes https://github.com/sbt/sbt/issues/3873
2018-02-15 23:04:43 -05:00
Dale Wijnand b50cc6f342
Merge pull request #215 from 2m/wip-no-decimals-2m
Use only integers for versions
2018-02-14 14:21:06 +00:00
Martynas Mickevičius 5a0bde442d
Use only integers for versions 2018-02-14 14:00:36 +02:00
Ethan Atkins 09a7152b1d Whitelist java9-rt-ext- output in rt export process
If -verbose:gc is set, there can be gc log output in this process that
prevents the directory from being properly extracted. Rather than
blacklist possible output strings, I think it makes more sense to
whitelist the specific output line that we're looking for.
2018-02-12 09:20:30 -08:00
Martynas Mickevičius e15633064b
Handle JDK 10 version string 2018-02-03 18:19:24 +01:00
Phil 13f2bafdf8 remove invisible carriage-return appended to java_version under cygwin 2018-01-05 14:36:17 -07:00
Dale Wijnand 901e5794b8
Set both Xms & Xmx when running java -version
See the comments in #203.

My choice of minimum memory is basically arbitrary.
2018-01-04 10:18:18 +00:00
Marcos Pereira f9295a6715
Remove -Xmx512M flag when detecting java version
The flag can cause problems when there is another configuration
adding -Xms with a value bigger than 512M. The `java -version`
command will fail and no java version will be detected, causing
a failure in `checkJava`.
2018-01-02 18:15:07 -02:00
Fulvio Valente 6ad16c2b74 Use expr instead of bc when checking Java versions.
Because expr is in coreutils, we can expect it to be present on systems unlike bc.

Fixes #198
Fixes #192
2017-11-16 15:11:19 +00:00
Matthias Kurz 006a5eee23
Ignore debug output when getting runtime jar path 2017-11-15 11:55:12 +01:00
Brett Randall da02335261 Changed references to downloading/installing/updating Java (JRE?) to refer to JDK.
Updated download URLs. Fixed #115.
2017-11-10 19:48:05 +00:00
Michael Stringer 97f38b5a1d
Set -XX:+UseParallelGC on Java 9 2017-09-28 20:00:33 +01:00
Guillaume Martres 32e8859df6 Support Java 10
In bash, "10" < "1.6" returns false, because it's a string comparison.
Use bc instead to compare decimal numbers.
2017-09-19 13:33:07 +02:00
Jason Zaugg c487e3166e Fix java version detection in bash script
`java -version` can include an extra line of output
if `_JAVA_OPTTIONS` is set.

This commit adds a grep step before sed to harden
against this possibility.

Before:
```
 (export _JAVA_OPTIONS=-Dfoo.bar; java -version 2>&1 | sed 's/.*version "\([0-9]*\)\(\.[0-9]*\)\{0,1\}\(.*\)*"/\1\2/; 1q')
Picked up _JAVA_OPTIONS: -Dfoo.bar
```

After:
```
 (export _JAVA_OPTIONS=-Dfoo.bar; java -version 2>&1 | grep ' version "' | sed 's/.*version "\([0-9]*\)\(\.[0-9]*\)\{0,1\}\(.*\)*"/\1\2/; 1q')
1.8
```
2017-07-26 14:57:58 +10:00
tksk b66b0ff7f6 Fix: multiple execution of universal:stage task produces duplicated version strings 2017-05-05 15:45:20 +09:00
tksk ab3de739d7 detect $init_sbt_version 2017-04-28 02:28:16 +09:00
eugene yokota d5f8aff4c2 Merge pull request #156 from sbt/wip/150
Workaround for brew test sbt
2017-04-12 20:20:57 -04:00
Eugene Yokota 36e8246825 Workaround for brew test sbt
brew test sbt doesn't detect java version correctly. This change makes the script a bit more safer.

Fixes #150
2017-04-12 07:57:27 -04:00
Eugene Yokota 226c34a7bf Replace realpath with something Mac compat
Mac by default doesn't have realpath(1).
This replaces it with an equivalent bash script, so we can reduce script replacements on Homebrew.

Fixes #149
2017-04-12 07:53:43 -04:00
Eugene Yokota 0f8b3b0ffb Fix bash script 2017-04-07 04:13:13 -04:00
Eugene Yokota 2fad446e67 Make offline installer optional 2017-04-07 00:56:55 -04:00
Eugene Yokota d3ca77a95d mkdir before rsync
Fixes sbt/sbt#3005
2017-04-07 00:32:16 -04:00
Eugene Yokota 1ea1f5d52d mkdir -p
Fixes sbt/sbt#3005
2017-03-17 16:54:04 -04:00
monktastic c7f3be3b58 Preserve quotes in system properties
Today you cannot have spaces in system properties:

$ sbt -Dfoo="bar baz" ...

It passes [-Dfoo=bar] and [baz] to java (see https://github.com/sbt/sbt/issues/2787).

This change allows you to do:

$ sbt "-Dfoo=bar baz"

which will pass ["-Dfoo=bar baz"]. And both of these two:

$ sbt "-Dfoo=bar"
$ sbt -Dfoo=bar

still work, passing [-Dfoo=bar].
2017-03-16 17:01:57 -07:00
Eugene Yokota e4dae9a120 Fix Java 9 support 2017-03-11 16:34:10 -05:00
Eugene Yokota cea5d178d8 add offline installtion
To utilize local preloaded repo, this will create lib/ directory with all artifacts required for sbt. This can be rsynced to the preloaded repo.
2017-03-10 16:56:00 -05:00
Eugene Yokota 39d8504045 --rt-ext-dir returns a dir specific to JDK 9 ver 2017-03-09 20:10:59 -05:00
Eugene Yokota 605a17d949 move JDK9 logic within copyRt 2017-02-19 09:16:40 +01:00
Eugene Yokota f77c15496b add JDK 9 support 2017-02-15 04:57:47 -05:00
Eugene Yokota acd610be67 Fix checkJava function 2017-01-16 03:09:29 -05:00
eugene yokota 86afaaebb4 Merge pull request #134 from Atry/patch-2
Don't set MaxMetaspaceSize on Java 8 by default
2017-01-11 10:29:38 -05:00
Eugene Yokota f14b165523 Fix java version detection
Previously awk was used to grab the full Java version such as 1.8.0_91.
While this is more accurate, 1.8.0_91 is not a number that can be compared by bash, and thus JDK8 detection logics were failing.
Fixes #135
2017-01-11 00:20:38 -05:00
杨博 (Yang Bo) e1d64533f3 Don't set MaxMetaspaceSize on Java 8 by default 2017-01-11 12:00:34 +08:00
Sam Halliday d9da67979a -java-home should set PATH for javac usage 2016-08-25 20:16:35 +01:00
Eugene Yokota 843a60734b Fixes #104. Allow individual memory options to be controlled
When a `-J` option is passed in such as `-J-XX:MaxPermSize=1001M`, it
will override only that option.
2016-02-19 17:46:05 -05:00
Mihai Capotă 0d9806b9ff Check memory options in JAVA_TOOL_OPTIONS
JAVA_TOOL_OPTIONS is used by the JVM [1] so it must also be checked for memory options that conflict with the ones set in get_mem_opts.

[1] https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html
2016-02-17 11:26:13 -08:00
Eugene Yokota 40167af167 Handle SBT_OPTS
Fixes sbt/sbt-launcher-package#99 formerly known as sbt/sbt#2194.
get_mem_opts() is a bash function that generates memory related
options. This change makes it return `""` the SBT_OPTS variable
contains memory-related options already.
2016-01-21 23:26:25 -05:00
William Waites 892de8e7d7 Set resource limit for ${java_cmd} -version in sbt initialisation
Java is a little anti-social and attempts to lazily allocate all
of system memory, even for simple operations such as printing out
the version. This causes sbt to fail to start in environments
where resources are limited (i.e. ulimit(1)). This setup is common
on shared infrastructure such as scientific computing clusters
where because of the resource limit not being specified sbt cannot
be used.

The limit is set to 512MB which ought to be ample and is in any case
the default from sbtconfig.txt. A better patch would use the limit
specified there but it isn't clear that that is worth the effort.
2015-01-20 13:16:33 +00:00