So now none of the cross platform stuff works in the sdk now that oracle shafted netbeans.
There is no download.oracle.com anymore so is there a place in the sdk we can edit to pull in the jre for cross platform stuff rather than downloading this manually?
Also, the obfuscation doesnt work either, there’s this error even though the platform exists and so does the jar.
Can’t read [C:\xxx\${platform.home}\jre\lib\rt.jar] (No such file or directory)
AdoptOpenJDK seems to be a reasonable source for obtaining pre-built JVMs. That said, I think the source is not all that important as long as it’s handled as part of the SDK build process - there’s always another recent and trustworthy OpenJDK build out there. The most important aspect of this, I think, is keeping the SDK up to date with Java releases. JDKs 9+ have come a long way and offer many tools that could be a huge benefit to game developers (custom runtime images, anyone?), and future projects (like the Graal JIT) are just as promising. Keeping the JDK up to date is going to be critical to the SDK’s long-term prospects, and AdoptOpenJDK seems like a fine source for now - but I’m personally not concerned about what happens if they go away since there are (and will be) alternatives.
Not quite sure I follow. Getting a JNLP-bundled application to run was always kind of a crapshoot in my experience anyway. Despite what the proponents of Web 5,000.0+ would lead us to believe, I’ve never seen a user experience that could rival a reasonably well-packaged native installer and application. I wouldn’t go so far as to call installers “easy” per se, but they are a well-known problem with many viable solutions. Once you have a jlinked runtime for your target platform, it’s all just bundling things in a suitable way after that. In the absence of JNLP we’re pretty much just left with doing what many games do today and building/installing an updater alongside the game application.
Thisis what caught my eye and if I understand this, its saying they dont need the jre now but the openJDK… pre-installed.
Customizing the Java 11 runtime:
Unfortunately, there’s no way to customize cross-platform Java runtimes, so we need an intermediate Windows computer—let’s call it the IWC. (I’m going to come right out and say this is the major drawback of our approach.)
So Java 9 added the concept of “runtime images” - unlike the old JRE, these contain only the VM itself and whatever JRE “modules” you specify to include. The result is a custom runtime that (a) runs only on the platform you built it on, and (b) includes only the standard library packages that were in the modules you selected. After it’s built, that’s it - you can’t really customize it per se (although at runtime you can still change the classpath/module path via command line arguments).
Sort of - to build an image for Linux, you need to have a Linux machine to run the jlink on. Same for Windows, Mac, etc. It’s not cross-platform in the sense of building the VM image once and running it anywhere.
What we’d have to do is jlink the runtime on each OS that we want to target (as part of the SDK build process) and include all of those pre-built runtimes as part of the distributed SDK. It’s no materially different than building the jME native bindings for each target platform.
That’s why they’re talking about needing the “extra” Windows machine - the developer was working on Linux but needed a jlinked VM for Windows. Once you’ve built the VM once you don’t need to do it again (unless you want to include more modules or you’re updating to a new VM, etc.).
Adopt has the jre also and I think I read they will continue too so I am going to try and download the jres tommorrow and see if the SDK will work using them.
> Task :overrideHarness FAILED
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Robert\Documents\NetBeansProjects\sdk\build.gradle' line: 5
57
* What went wrong:
Execution failed for task ':overrideHarness'.
> Cannot find targetFile: C:\Users\Robert\Documents\NetBeansProjects\sdk\netbean
s\harness\launchers\app.exe
As is to be expected, always some other is always screwed up.
I saw this thread, but no idea wtf a soft link is /sac but its expected to throw an exception because of course the file does not exist.
Since netbeans is no longer online at oracle, maybe its related? Not sure how to get this file.
def patch_file = { f ->
def g = file("harness-override/" + f.getName())
if (!f.exists()) {
throw new GradleException('Cannot find targetFile: ' + f.getAbsolutePath());
}
No idea where f comes from or how it gets decalared here since I dont use this lambada crap (java is intended to be an expressive language not terse!).
patch_file = { } is defining a closure. Normally closures in groovy have one argument called ‘it’… but often it’s more readable if the closure defines a different name for that argument. The part before the → defines that.
foo = { arg1, arg2 ->
}
Would define a two argument closure with arguments of no particular type.
foo = { File f1, File f2, String arg3 ->
}
Would define a three argument closure with the types as specified.
Edit: and note, closures and lambda are not really the same thing but they are frequently used interchangeably. Here “closure” is more correct.
Yes a path to a file that doesnt exist. Since this folder gets populated during the build, I have no idea where its supposed to get this. I read this in the harnes-override folder.
Since our SDK is based on Netbeans we download the so-called Netbeans Harness from official sources.
So I am thinking this is related? and maybe since netbeans is no longer exsists at oracle may need to download it somehow from apache maybe?
Note: it constructs the g from the harness-override directory but it’s checking the existence of the supplied file.
And if you are ever curious what these actually point to and are able to modify the .gradle file, you can just print them out:
println f.getCanonicalFile();
println g.getCanonicalFile();
> Task :buildSdk FAILED
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Robert\Documents\NetBeansProjects\sdk\build.gradle' line: 6
11
* What went wrong:
Execution failed for task ':buildSdk'.
> The following error occurred while executing this line:
C:\Program Files\NetBeans 8.1\harness\suite.xml:187: The following error occur
red while executing this line:
C:\Program Files\NetBeans 8.1\harness\build.xml:174: Cannot compile against a
module: C:\Program Files\NetBeans 8.1\platform\modules\org-netbeans-api-template
s.jar because of dependency: org.netbeans.api.templates > 1.7.1 found 1.6.1
No wonder no one helps with SDK. Not worth this amount of trouble realy just to try and change a few lines of code.