how to fix Javac invalid flag error? - applet

I am trying to compile a an STK applet.
Firstly, I would like to compile the .java class by using javac. I am getting an error (invalid flag); this is my command:
C:\Program Files (x86)\Java\jdk1.8.0_20\bin>javac C:\Users\user\Desktop\ImsiManager Applet\2014-07-34_ImsiManager_src\2014-07-34_ImsiManager_src\ImsiManager\src\main\java\com\simulity\javacard\imsimanager\ImsiManager.java
Javac: invalid flag: C:\Users\user\Desktop\ImsiManager
Usage: javac <options> <source files>
use -help for a list of possible options

The problem are the spaces, you should enclose it with quotes:
javac "C:\Users\user\Desktop\ImsiManager Applet\2014-07-34_ImsiManager_src\2014-07-34_ImsiManager_src\ImsiManager\src\main\java\com\simulity\javacard\imsimanager\ImsiManager.java"

Related

Cannot compile mex file on Windows

When I attempt to compile a .mex file on Windows, I get the following error. How can I fix this?
Error using mex
MEX cannot find library 'mwblas' specified with the -l option.
MEX looks for a file with one of the names:
libmwblas.lib
mwblas.lib
Please specify the path to this library with the -L option
As the error message states, you need to specify the directory in which the .lib file is located using the -L option or specify the full path to the .lib file as an input to mex. This library is located in matlabroot/extern/lib. So you could do something like
blas = fullfile(matlabroot,'extern','lib',computer('arch'),'microsoft', 'libmwblas.lib');
mex('-largeArrayDims', 'mymexfile.cpp', blas)
Or you can specify the folder with -L
libdir = fullfile(matlabroot,'extern','lib',computer('arch'),'microsoft');
mex('-largeArrayDims', ['-L', libdir], '-lmwblas', 'mymexfile.cpp', )
More info about compiling mex files to use LAPACK and BLAS is here

How to pass a local file name to css-validator.jar?

I'm trying to open a file from the filesystem with css-validator.jar. I tried:
java -jar css-validator.jar C:\filename and
java -jar css-validator.jar file:\\\filename
but neither worked.
What am I doing wrong?
Figured it out on my own: command used in directory of jar is like this:
java -jar css-validator.jar -output gnu file:///"Directory of file"\"name of css file".css
You can then add > or >> and a text type file extension (.txt, .html, .xml, .doc[but not .docx]) to output to file. the gnu can also be text, xml, or a couple other formats.

Issues with g++ and Eclipse on Linux - unresolved symbols

I am running Ubuntu 64bit version, and downloaded the latest 64bit Eclipse.
Installed g++ along with build-essential. Tested g++ to make sure it works from terminal, and it works fine.
alex#ubuntu:~/Desktop$ g++ test.cpp -o test
alex#ubuntu:~/Desktop$ ./test
Hello World!alex#ubuntu:~/Desktop$
However, trying to build simple C++ Hello Word project(one of the default projects that comes with Eclipse), I am getting error.
Description Resource Path Location Type
Program "g++" not found in PATH Preferences, C++/Build/Settings/Discovery, [CDT GCC Builtin Compiler Settings] options C/C++ Scanner Discovery Problem
I have added Environment variable named g++ with value /usr/bin/g++ and the above error went away, however, now I am getting unresolved errors, though project compiles and in the Console shows !!!Hello World!!!
Description Resource Path Location Type
Symbol 'endl' could not be resolved test_hello.cpp /test_hello/src line 13 Semantic Error
Symbol 'cout' could not be resolved test_hello.cpp /test_hello/src line 13 Semantic Error
Symbol 'std' could not be resolved test_hello.cpp /test_hello/src line 10 Semantic Error
Have I correctly entered Environmental variable ?? How can I get fix the "unresolved" error ?? Thanks !
When compiling there are two important things to consider:
1.) Is my path up-to-date with executables?
2.) Is my library path correct?
It appears you satisfy 1.) but not 2.)
The unresolved symbol error means that Eclipse cannot find your library via LD_LIBRARY_PATH or some other medium. It's attempting to locate the standard compiled C++ library.
How did you install g++?
Kindly do this and post the results:
Project > Properties > C/C++ Build > Environment
If everything there appears nominal, you can try
/sbin/ldconfig
which should hopefully re-parse your system library paths and might update your environment.

sbt: Unable to specify application configuration in mingw

I am trying to launch an application using sbt's application launcher.
This application is defined as:
#!/bin/sh
java -jar /home/salil.wadnerkar/.conscript/sbt-launch.jar #"/home/salil.wadnerkar/.conscript/n8han/conscript/cs/launchconfig" "$#"
However, when I launch it, it gives me this error:
$ ~/bin/cs n8han/giter8
Error during sbt execution: Could not find configuration file 'C:/MinGW/msys/1.0/home/salil.wadnerkar/.conscript/n8han/conscript/cs/launchconfig'. Searched:
file:/C:/MinGW/msys/1.0/home/salil.wadnerkar/
file:/C:/Users/salil.wadnerkar/
file:/C:/MinGW/msys/1.0/home/salil.wadnerkar/.conscript/
However, the file is present there. So, I think it's because of some quirk in the way sbt handles mingw file path.
Does anybody know how I can get it working?
In Cygwin I used
java -jar "`cygpath -m "$HOME/.conscript/sbt-launch.jar"`" "#file:///C:/Users/cvanvranken/.conscript/n8han/conscript/cs/launchconfig" "$#"
I expect you will be able to get yours to work with something similar, perhaps this:
java -jar /home/salil.wadnerkar/.conscript/sbt-launch.jar "#file:///C:/Users/salil.wadnerkar/.conscript/n8han/conscript/cs/launchconfig" "$#"
or
java -jar /home/salil.wadnerkar/.conscript/sbt-launch.jar "#file:///C:/MinGW/msys/1.0/home/salil.wadnerkar/.conscript/n8han/conscript/cs/launchconfig" "$#"
if those fail, you still definitely need to use the file:// protocol.
Also note the three directories it is searching in the error message
file:/C:/MinGW/msys/1.0/home/salil.wadnerkar/
file:/C:/Users/salil.wadnerkar/
file:/C:/MinGW/msys/1.0/home/salil.wadnerkar/.conscript/
no matter what you put in the launchconfig parameter, if it is not recognized then those directories are searched by default. So you could have gibberish in your parameter and still see the same exact error you are getting now.
you can set the launch config path relative to the .conscript folder -
java -jar /home/salil.wadnerkar/.conscript/sbt-launch.jar #n8han/conscript/cs/launchconfig "$#"

Winsock2.h include error

Did anyone try to include winsock2.h and then tried to compile it on cygwin? Unfortuantely
I get the following error message:
winsock2.h:635: error: declaration of C function 'int gethostname(char*, int)' conflicts with
/usr/include/sys/unistd.h:2006: error: previous declaration 'int gethostname(char, size t)' here
Does anyone know how I can fix this "bug"?
Thanks
winsock2.h is for the Windows enviroment. The cygwin headers should contain sys/socket.h. Use that instead.
Cygwin is an environment for compiling POSIX compliant programs on Windows. If you want to compile Windows compliant programs on Windows, use MinGW instead.