i follow the tutorial https://class.coursera.org/progfun-005/lecture/21
to install Scala.
I have already java install in it.As the tutorial guides i download the latest sbt and install it.
But when i am trying to run in command prompt by typing
sbt sbtVersion it gives an error that "Files was unexpected at this time"
I am new in this so ignore if i am making any silly error
Download the jar and run it using java -jar /location/of/the/downloaded/jar/from/the/previous/link -- leave a comment if you have further problems.
Related
I have a Java Code where I am able to run it on Intellij using custom configuration. The configuration has following attributes :-
module : java 8 (Oracle OpenJDK 1.8.0_321)
classpath : -cp XYZ.main()
main : com.ABC.XYZ.ManageTraffic
CLI arguements : server XYZ.yml
But when I try to run the jar that was build using gradle from terminal , it gives me Error , could not find or load main class com.ABC.XYZ.ManageTraffic
So far I have tried the following things looking at other solutions at Stackoverflow , still getting the same error
java -jar ques.jar
java -jar ques.jar com.ABC.XYZ.ManageTraffic
java -cp /build/libs/ques.jar com.ABC.XYZ.ManageTraffic
Just to cross check , I unzipped the creataed jar and found that com.ABC.XYZ.ManageTraffic class file is available there , still getting error. What could be the issue?
Run it from the IDE, and while it is running, try to get the command used by the IDE from the process list.
not sure what OS you are using but something like this should work on linux/mac:
ps -ef | grep java
After you have the command you can try to understand why its not working for you, or just use that command
Just want to add how I managed to run it. I created a new shaded jar file of the same application. refreshed its dependencies and now it works. I am yet to find out how creating a shaded jar instead of normal jar helped. Right now the only reason I could figure out is there may be version clashes with some dependencies but I wonder how it could throw could not found main class error.
Anyways , then I ran the file with the following command from terminal:
java -jar ./build/libs/ques-shaded.jar server XYZ.yml
I'm having quite a bit of trouble with ./gradlew. I am trying to make a 1.14.4 mod, and have been having a lot of problems with gradle, but I've finally got gradle working (an error in my build.gradle code). I'm on a Mac, and my friend (with whom I am building the mod) is not, and running
./gradle wrapper
works fine on his computer but not on mine. It must be a system issue, but I'm really not sure. The error I keep getting is:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().
I've looked online, and all of the work-arounds I have found doesn't help me. Running ./gradlew wrapper with --info I get this. Running with --stacktrace, I get this. Finally, with --debug I get this. I don't know if these are helpful (I'm sure they are, if you know what to look for).
Any insights into what on earth is causing this is greatly appreciated!
P.S.: my made-up username in the pastebin links is drdeducer :)
P.P.S.: it isn't just ./gradlew wrapper that doesn't work; it is ./gradlew <anything>—even just ./gradlew!
Found the problem for me. In the process of trying to initially get gradle working, I added touch ~/.gradle/gradle.properties and specified org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-12.jdk/Contents/Home. Typing /usr/libexec/java_home -V you will get a list of your Java versions, so in my local gradle.properties, I had to specify a Java version less than 11 (it ended up being open adoptopenjdk-8.jdk). To see Java versions, type brew search java, and then brew cask install <desired java version> (for mac users).
I have already gotten The Jcreator program installed, now i just need help with downloading JDK, whenever I run Jcreator I get this error :
Failed to start the following executable, \bin\javac.exe -g -classpath "C:\Users\IDOTASDAS\Documents\JCreator LE\MyProjects\Stupid\classes" -d C:\Users\IDOTASDAS\Documents\JCreator" "LE\MyProjects\Stupid\classes C:\Users\IDOTASDAS\Documents\JCreator" LE\MyProjects\Stupid\src\Stupid.java
For help, please refer to http://www.jcreator.com/installation.htm
Process completed.
so I go to the site, download the software, and this error continues to pop up. Am I doing anything wrong?
Just download the JDK from the official site.
My Rails app relies on legacy Java code for a piece of its logic. It runs the code via shell commands: javac whatever and then java whatever. However, after deploying to Heroku, the request fails because it can't locate javac or java.
What's the best way to install Java in a Rails app? I tried using a multi-buildpack solution, with this .buildpacks:
https://github.com/heroku/heroku-buildpack-ruby.git
https://github.com/heroku/heroku-buildpack-java.git
But I get this error:
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-java.git
! Push rejected, failed to compile Multipack app
I tried forking the Ruby buildpack and installing Java directly from there, but I don't really know what I'm doing. Any ideas?
Try using heroku-buildpack-jvm-common instead of the Java buildpack. So your .buildpacks file will look like this:
https://github.com/heroku/heroku-buildpack-jvm-common.git
https://github.com/heroku/heroku-buildpack-ruby.git
It's probably a good idea to put the JVM one before the Ruby one in case javac or java are needed at compile/build time.
The JVM buildpack is essentially the same as the Java buildpack, but doesn't install Maven and thus does not require a pom.xml file. The missing pom.xml is why you got that error I think.
EDIT
In the modern era, you can also run:
$ heroku buildpacks:add heroku/jvm
$ heroku buildpacks:add heroku/ruby
I have successfully compiled the "Hello World" example found on this link: http://code.google.com/p/matlabcontrol/wiki/Walkthrough.
However, when I try to run it, I get the following exception:
Exception in thread "main" matlabcontrol.MatlabConnectionException:
Could not launch MATLAB. Command: [matlab, -desktop, -r, javaaddpath '/usr/local/MATLAB/R2011a/java/jar/matlabcontrol-4.0.0.jar'; matlabcontrol.MatlabClassLoaderHelper.configureClassLoading(); javarmpath '/usr/local/MATLAB/R2011a/java/jar/matlabcontrol-4.0.0.jar'; matlabcontrol.MatlabConnector.connectFromMatlab('PROXY_RECEIVER_6eb278d0-1401-4b9c-b9e4-80512708f9b7', 2100);].
I have Matlab2011a installed in Ubuntu 11.10.
Could anyone point out where the problem could possibly be?
If you check the compatibility between OS and MATLAB version?
https://code.google.com/p/matlabcontrol/wiki/Compatibility
I suggest that you should update matlabcontrol-4.0.0.jar to latest version matlabcontrol-4.1.0.jar which can be downloaded from website.
Remember to open MATLAB before running the code and check if you have included all related jar files (jmi.jar...etc)to the java build path.
That exception that you posted suggests that you need to add Matlab to your system path. Check online guides on how to do that on Ubuntu.