365 | releases | |
365 | releases | |
366 releases := self allSubclasses reject:[:each | each isAbstract ] thenCollect:[:each | each new ]. |
366 releases := self allSubclasses reject:[:each | each isAbstract ] thenCollect:[:each | each new ]. |
367 releases sort:[:a :b | a priority > b priority ]. |
367 releases sort:[:a :b | a priority > b priority ]. |
368 releases do:[:release | |
368 releases do:[:release | |
369 (release validateJavaExecutable: javaExecutable) ifTrue:[ |
369 (release validateJavaExecutable: javaExecutable) ifTrue:[ |
370 release javaExecutable: javaExecutable. |
370 "/ release javaExecutable: javaExecutable. |
371 ^ release. |
371 ^ release. |
372 ]. |
372 ]. |
373 ] |
373 ] |
374 ]. |
374 ]. |
375 ^ nil. |
375 ^ nil. |
1522 |
1522 |
1523 ^#osxJDK6 |
1523 ^#osxJDK6 |
1524 ! ! |
1524 ! ! |
1525 |
1525 |
1526 !JavaRelease::AppleJDK6 methodsFor:'searching'! |
1526 !JavaRelease::AppleJDK6 methodsFor:'searching'! |
|
1527 |
|
1528 javaExecutableForJavaHome: javaHomeArg |
|
1529 "For given java home (path to JRE root if JRE, or JDK root if part of full JDK) return |
|
1530 path to java executable (java.exe on Windows, java on UNIX). If no executable is found |
|
1531 in given root, return nil." |
|
1532 |
|
1533 | javaHomeDirectory javaExecutableName javaExecutable | |
|
1534 |
|
1535 "/ By default, java executable is either in <jdk root>/jre/bin or |
|
1536 "/ <jre root>/bin. So far only AppleJDK is different... |
|
1537 |
|
1538 javaHomeArg isNil ifTrue:[ ^ nil ]. |
|
1539 javaHomeDirectory := javaHomeArg asFilename asAbsoluteFilename. |
|
1540 javaHomeDirectory exists ifFalse:[ ^ nil ]. |
|
1541 javaHomeDirectory isDirectory ifFalse:[ ^ nil ]. |
|
1542 javaExecutableName := OperatingSystem isMSWINDOWSlike ifTrue:[ 'java.exe' ] ifFalse:[ 'java' ]. |
|
1543 |
|
1544 javaExecutable := javaHomeDirectory / 'Commands' / javaExecutableName. |
|
1545 javaExecutable exists ifTrue:[ ^ javaExecutable ]. |
|
1546 |
|
1547 ^ nil |
|
1548 |
|
1549 " |
|
1550 JavaRelease basicNew javaExecutableForJavaHome: (OperatingSystem pathOfCommand:'java') asFilename directory directory. |
|
1551 JavaRelease basicNew javaExecutableForJavaHome: '/usr/lib/jvm/java-7-openjdk-amd64/jre' |
|
1552 JavaRelease basicNew javaExecutableForJavaHome: '/usr/lib/jvm/java-7-openjdk-amd64' |
|
1553 JavaRelease basicNew javaExecutableForJavaHome: 'xxxx' |
|
1554 JavaRelease basicNew javaExecutableForJavaHome: '/usr/bin' |
|
1555 " |
|
1556 |
|
1557 "Created: / 08-04-2014 / 14:44:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1558 ! |
|
1559 |
|
1560 javaHomeForJavaExecutable: javaExecutable |
|
1561 "For given java executable (java.exe on Windows, java on UNIX) return |
|
1562 a Java home (path to JRE root (if JRE) or JDK root (if part of full JDK). |
|
1563 Upon failure (executable does not seem to be a part of JRE nor JDK), return |
|
1564 nil." |
|
1565 |
|
1566 | javaExecutableFilename jdk| |
|
1567 |
|
1568 "/ By default, java executable is either in <jdk root>/jre/bin or |
|
1569 "/ <jre root>/bin. So far only AppleJDK is different... |
|
1570 |
|
1571 javaExecutable isNil ifTrue:[ ^ nil ]. |
|
1572 javaExecutableFilename := javaExecutable asFilename asAbsoluteFilename. |
|
1573 javaExecutableFilename exists ifFalse:[ ^ nil ]. |
|
1574 javaExecutableFilename isExecutable ifFalse:[ ^ nil ]. |
|
1575 |
|
1576 jdk := '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK' asFilename. |
|
1577 jdk exists ifFalse:[^ nil]. |
|
1578 |
|
1579 (jdk construct:'Classes') exists ifFalse:[^ nil]. |
|
1580 (jdk construct:'Classes/classes.jar') exists ifFalse:[^ nil]. |
|
1581 ^ jdk |
|
1582 |
|
1583 " |
|
1584 JavaRelease basicNew javaHomeForJavaExecutable: (OperatingSystem pathOfCommand:'java') |
|
1585 JavaRelease basicNew javaHomeForJavaExecutable: '/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java' |
|
1586 JavaRelease basicNew javaHomeForJavaExecutable: 'xxxx' |
|
1587 JavaRelease basicNew javaHomeForJavaExecutable: '/usr' |
|
1588 " |
|
1589 |
|
1590 "Created: / 08-04-2014 / 14:21:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1591 ! |
1527 |
1592 |
1528 searchForSourcePath |
1593 searchForSourcePath |
1529 |
1594 |
1530 | jdkHome src_zip | |
1595 | jdkHome src_zip | |
1531 |
1596 |
1547 " |
1612 " |
1548 |
1613 |
1549 "Created: / 03-09-2012 / 18:38:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1614 "Created: / 03-09-2012 / 18:38:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1550 "Modified: / 23-01-2013 / 12:22:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1615 "Modified: / 23-01-2013 / 12:22:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1551 "Modified (comment): / 06-02-2013 / 12:55:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1616 "Modified (comment): / 06-02-2013 / 12:55:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1617 ! |
|
1618 |
|
1619 validateJavaHome1: home |
|
1620 |
|
1621 home isNil ifTrue:[ ^ false ]. |
|
1622 |
|
1623 ( home asFilename / 'Classes' / self nameOf_rt_dot_jar ) exists ifTrue:[^true]. |
|
1624 |
|
1625 ^ false |
|
1626 |
|
1627 " |
|
1628 JavaRelease basicNew validateJavaHome: '/usr/lib/jvm/java-6-openjdk' |
|
1629 JavaRelease basicNew validateJavaHome: '/tmp' |
|
1630 " |
|
1631 |
|
1632 "Created: / 12-02-2013 / 02:50:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1552 ! ! |
1633 ! ! |
1553 |
1634 |
1554 !JavaRelease::AppleJDK6 methodsFor:'validating'! |
1635 !JavaRelease::AppleJDK6 methodsFor:'validating'! |
1555 |
1636 |
1556 validateJavaHome2: home |
1637 validateJavaHome2: home |