Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1009052 - pathToJavaxJar

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4747L/29K).

// TODO: use actualUserHome()?
// (there was a problem with onLocallyInferiorJavaX() always triggering inside #1013896)

static File pathToJavaxJar() {
  ifndef NoResourceLoader
  IResourceLoader rl = vm_getResourceLoader();
  if (rl != null)
    ret rl.pathToJavaXJar();
  endifndef
  
  ret pathToJavaxJar_noResourceLoader();
}
  
static File pathToJavaxJar_noResourceLoader() ctex {
  int x = latestInstalledJavaX();
  File xfile = new File(userHome(), ".javax/x" + Math.max(x, 30) + ".jar");
  if (!xfile.isFile()) {
    print("Saving " + f2s(xfile));
    String url = x30JarServerURL();
    byte[] data = loadBinaryPage(url);
    if (data.length < 1000000)
      fail("Could not load " + url);
    saveBinaryFile(xfile.getPath(), data);
  }
  ret xfile;
}

Author comment

Began life as a copy of #1000838

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009052
Snippet name: pathToJavaxJar
Eternal ID of this version: #1009052/7
Text MD5: 24425a89931090e30e33590957a76a3e
Transpilation MD5: 3fe179c68576e56f07f8e530b17ae43d
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-03 21:01:51
Source code size: 785 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 362 / 413
Version history: 6 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1009052 & http://1009052.tinybrain.de